Kaydet (Commit) 1a162570 authored tarafından Caolán McNamara's avatar Caolán McNamara

adapt code to edit categories dialog .ui

Change-Id: Ib03ec188ba30d122ff687937209b989d418fe7ac
üst 3fa2c6da
...@@ -139,7 +139,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ ...@@ -139,7 +139,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/lingu/olmenu.src \ sw/source/ui/lingu/olmenu.src \
sw/source/ui/misc/autocorr.src \ sw/source/ui/misc/autocorr.src \
sw/source/ui/misc/docfnote.src \ sw/source/ui/misc/docfnote.src \
sw/source/ui/misc/glosbib.src \
sw/source/ui/misc/glossary.src \ sw/source/ui/misc/glossary.src \
sw/source/ui/misc/numberingtypelistbox.src \ sw/source/ui/misc/numberingtypelistbox.src \
sw/source/ui/misc/outline.src \ sw/source/ui/misc/outline.src \
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <svx/svxcommands.h> #include <svx/svxcommands.h>
#include <sfx2/sfxcommands.h> #include <sfx2/sfxcommands.h>
#define HID_BIB_BASE "SW_HID_BIB_BASE"
#define HID_MERGE_PRINTMONITOR "SW_HID_MERGE_PRINTMONITOR" #define HID_MERGE_PRINTMONITOR "SW_HID_MERGE_PRINTMONITOR"
#define HID_FLD_INPUT "SW_HID_FLD_INPUT" #define HID_FLD_INPUT "SW_HID_FLD_INPUT"
#define HID_DOCINFO_EDT "SW_HID_DOCINFO_EDT" #define HID_DOCINFO_EDT "SW_HID_DOCINFO_EDT"
......
...@@ -35,9 +35,16 @@ class SwGlossaryHdl; ...@@ -35,9 +35,16 @@ class SwGlossaryHdl;
class FEdit : public Edit class FEdit : public Edit
{ {
public: public:
FEdit(Window * pParent, const ResId& rResId) : FEdit(Window* pParent, const ResId& rResId)
Edit(pParent, rResId){} : Edit(pParent, rResId)
{
}
FEdit(Window* pParent)
: Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
{
}
virtual void KeyInput( const KeyEvent& rKEvent ); virtual void KeyInput( const KeyEvent& rKEvent );
}; };
...@@ -52,27 +59,28 @@ struct GlosBibUserData ...@@ -52,27 +59,28 @@ struct GlosBibUserData
class SwGlossaryGroupTLB : public SvTabListBox class SwGlossaryGroupTLB : public SvTabListBox
{ {
public: public:
SwGlossaryGroupTLB(Window* pParent, const ResId& rResId) : SwGlossaryGroupTLB(Window* pParent, const ResId& rResId)
SvTabListBox(pParent, rResId) {} : SvTabListBox(pParent, rResId)
{
}
SwGlossaryGroupTLB(Window* pParent)
: SvTabListBox(pParent, WB_BORDER|WB_HSCROLL|WB_CLIPCHILDREN|WB_SORT)
{
}
virtual void RequestHelp( const HelpEvent& rHEvt ); virtual void RequestHelp( const HelpEvent& rHEvt );
}; };
class SwGlossaryGroupDlg : public SvxStandardDialog class SwGlossaryGroupDlg : public SvxStandardDialog
{ {
FixedText aBibFT; FEdit* m_pNameED;
FEdit aNameED; ListBox* m_pPathLB;
FixedText aPathFT; SwGlossaryGroupTLB* m_pGroupTLB;
ListBox aPathLB;
FixedText aSelectFT; PushButton* m_pNewPB;
SwGlossaryGroupTLB aGroupTLB; PushButton* m_pDelPB;
PushButton* m_pRenamePB;
OKButton aOkPB;
CancelButton aCancelPB;
HelpButton aHelpPB;
PushButton aNewPB;
PushButton aDelPB;
PushButton aRenamePB;
typedef std::vector< ::rtl::OUString> OUVector_t; typedef std::vector< ::rtl::OUString> OUVector_t;
OUVector_t m_RemovedArr; OUVector_t m_RemovedArr;
......
...@@ -21,10 +21,7 @@ ...@@ -21,10 +21,7 @@
#include "rcid.hrc" #include "rcid.hrc"
#define STR_GLOSSARY_BIB_DLG (RC_MISC_BEGIN + 5)
#define DLG_DOC_FOOTNOTE (RC_MISC_BEGIN + 13) #define DLG_DOC_FOOTNOTE (RC_MISC_BEGIN + 13)
#define DLG_BIB_BASE (RC_MISC_BEGIN + 16)
#define DLG_INSERT_BOOKMARK (RC_MISC_BEGIN + 17) #define DLG_INSERT_BOOKMARK (RC_MISC_BEGIN + 17)
#define DLG_NUM_NAMES (RC_MISC_BEGIN + 18) #define DLG_NUM_NAMES (RC_MISC_BEGIN + 18)
#define DLG_SORTING (RC_MISC_BEGIN + 19) #define DLG_SORTING (RC_MISC_BEGIN + 19)
......
...@@ -35,10 +35,7 @@ ...@@ -35,10 +35,7 @@
#include <glosdoc.hxx> #include <glosdoc.hxx>
#include <swunohelper.hxx> #include <swunohelper.hxx>
#include <glosbib.hrc>
#include <misc.hrc> #include <misc.hrc>
#include <helpid.h>
#define PATH_CASE_SENSITIVE 0x01 #define PATH_CASE_SENSITIVE 0x01
#define PATH_READONLY 0x02 #define PATH_READONLY 0x02
...@@ -46,49 +43,44 @@ ...@@ -46,49 +43,44 @@
#define RENAME_TOKEN_DELIM (sal_Unicode)1 #define RENAME_TOKEN_DELIM (sal_Unicode)1
SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
std::vector<String> const& rPathArr, std::vector<String> const& rPathArr, SwGlossaryHdl *pHdl)
SwGlossaryHdl *pHdl) : : SvxStandardDialog(pParent, "EditCategoriesDialog",
SvxStandardDialog(pParent, SW_RES(DLG_BIB_BASE)), "modules/swriter/ui/editcategories.ui")
aBibFT( this, SW_RES(FT_BIB)), , pGlosHdl(pHdl)
aNameED( this, SW_RES(ED_NAME)),
aPathFT( this, SW_RES(FT_PATH)),
aPathLB( this, SW_RES(LB_PATH)),
aSelectFT( this, SW_RES(FT_SELECT)),
aGroupTLB( this, SW_RES(TLB_GROUPS)),
aOkPB( this, SW_RES(BT_OK)),
aCancelPB( this, SW_RES(BT_CANCEL)),
aHelpPB( this, SW_RES(BT_HELP)),
aNewPB( this, SW_RES(PB_NEW)),
aDelPB( this, SW_RES(PB_DELETE)),
aRenamePB( this, SW_RES(PB_RENAME)),
pGlosHdl(pHdl)
{ {
FreeResource(); get(m_pPathLB, "pathlb");
get(m_pNewPB, "new");
get(m_pDelPB, "delete");
get(m_pRenamePB, "rename");
get(m_pNameED, "name");
get(m_pGroupTLB, "group");
const int nAppFontUnits = 130;
long nWidth = LogicToPixel(Size(nAppFontUnits, 0), MAP_APPFONT).Width();
m_pPathLB->set_width_request(nWidth);
//just has to be something small, real size will be available space
m_pGroupTLB->set_width_request(nWidth);
long nTabs[] = long nTabs[] =
{ 2, // Number of Tabs { 2, // Number of Tabs
0, 160 0, nAppFontUnits
}; };
aGroupTLB.SetHelpId(HID_GLOS_GROUP_TREE); m_pGroupTLB->SetTabs( &nTabs[0], MAP_APPFONT );
aGroupTLB.SetTabs( &nTabs[0], MAP_APPFONT ); m_pGroupTLB->SetSelectHdl(LINK(this, SwGlossaryGroupDlg, SelectHdl));
aGroupTLB.SetStyle(aGroupTLB.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN|WB_SORT); m_pGroupTLB->GetModel()->SetSortMode(SortAscending);
aGroupTLB.SetSelectHdl(LINK(this, SwGlossaryGroupDlg, SelectHdl)); m_pNewPB->SetClickHdl(LINK(this, SwGlossaryGroupDlg, NewHdl));
aGroupTLB.GetModel()->SetSortMode(SortAscending); m_pDelPB->SetClickHdl(LINK(this, SwGlossaryGroupDlg, DeleteHdl));
aNewPB.SetClickHdl(LINK(this, SwGlossaryGroupDlg, NewHdl)); m_pNameED->SetModifyHdl(LINK(this, SwGlossaryGroupDlg, ModifyHdl));
aDelPB.SetClickHdl(LINK(this, SwGlossaryGroupDlg, DeleteHdl)); m_pPathLB->SetSelectHdl(LINK(this, SwGlossaryGroupDlg, ModifyHdl));
aNameED.SetModifyHdl(LINK(this, SwGlossaryGroupDlg, ModifyHdl)); m_pRenamePB->SetClickHdl(LINK(this, SwGlossaryGroupDlg, RenameHdl));
aPathLB.SetSelectHdl(LINK(this, SwGlossaryGroupDlg, ModifyHdl));
aRenamePB.SetClickHdl(LINK(this, SwGlossaryGroupDlg, RenameHdl));
for (size_t i = 0; i < rPathArr.size(); ++i) for (size_t i = 0; i < rPathArr.size(); ++i)
{ {
String sPath(rPathArr[i]); String sPath(rPathArr[i]);
INetURLObject aTempURL(sPath); INetURLObject aTempURL(sPath);
sPath = aTempURL.GetMainURL(INetURLObject::DECODE_WITH_CHARSET ); sPath = aTempURL.GetMainURL(INetURLObject::DECODE_WITH_CHARSET );
aPathLB.InsertEntry(sPath); m_pPathLB->InsertEntry(sPath);
sal_uLong nCaseReadonly = 0; sal_uLong nCaseReadonly = 0;
utl::TempFile aTempFile(&sPath); utl::TempFile aTempFile(&sPath);
aTempFile.EnableKillingFile(); aTempFile.EnableKillingFile();
...@@ -96,10 +88,10 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, ...@@ -96,10 +88,10 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
nCaseReadonly |= PATH_READONLY; nCaseReadonly |= PATH_READONLY;
else if( SWUnoHelper::UCB_IsCaseSensitiveFileName( aTempFile.GetURL())) else if( SWUnoHelper::UCB_IsCaseSensitiveFileName( aTempFile.GetURL()))
nCaseReadonly |= PATH_CASE_SENSITIVE; nCaseReadonly |= PATH_CASE_SENSITIVE;
aPathLB.SetEntryData(i, (void*)nCaseReadonly); m_pPathLB->SetEntryData(i, (void*)nCaseReadonly);
} }
aPathLB.SelectEntryPos(0); m_pPathLB->SelectEntryPos(0);
aPathLB.Enable(sal_True); m_pPathLB->Enable(sal_True);
const sal_uInt16 nCount = pHdl->GetGroupCnt(); const sal_uInt16 nCount = pHdl->GetGroupCnt();
for( sal_uInt16 i = 0; i < nCount; ++i) for( sal_uInt16 i = 0; i < nCount; ++i)
...@@ -113,13 +105,13 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, ...@@ -113,13 +105,13 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
pData->sGroupTitle = sTitle; pData->sGroupTitle = sTitle;
String sTemp(sTitle); String sTemp(sTitle);
sTemp += '\t'; sTemp += '\t';
pData->sPath = aPathLB.GetEntry((sal_uInt16)sGroup.GetToken(1, GLOS_DELIM).ToInt32()); pData->sPath = m_pPathLB->GetEntry((sal_uInt16)sGroup.GetToken(1, GLOS_DELIM).ToInt32());
sTemp += pData->sPath; sTemp += pData->sPath;
SvTreeListEntry* pEntry = aGroupTLB.InsertEntry(sTemp); SvTreeListEntry* pEntry = m_pGroupTLB->InsertEntry(sTemp);
pEntry->SetUserData(pData); pEntry->SetUserData(pData);
} }
aGroupTLB.GetModel()->Resort(); m_pGroupTLB->GetModel()->Resort();
} }
SwGlossaryGroupDlg::~SwGlossaryGroupDlg() SwGlossaryGroupDlg::~SwGlossaryGroupDlg()
...@@ -128,8 +120,8 @@ SwGlossaryGroupDlg::~SwGlossaryGroupDlg() ...@@ -128,8 +120,8 @@ SwGlossaryGroupDlg::~SwGlossaryGroupDlg()
void SwGlossaryGroupDlg::Apply() void SwGlossaryGroupDlg::Apply()
{ {
if(aNewPB.IsEnabled()) if(m_pNewPB->IsEnabled())
NewHdl(&aNewPB); NewHdl(m_pNewPB);
String aActGroup = SwGlossaryDlg::GetCurrGroup(); String aActGroup = SwGlossaryDlg::GetCurrGroup();
...@@ -141,9 +133,9 @@ void SwGlossaryGroupDlg::Apply() ...@@ -141,9 +133,9 @@ void SwGlossaryGroupDlg::Apply()
if( sDelGroup == aActGroup ) if( sDelGroup == aActGroup )
{ {
//when the current group is deleted, the current group has to be relocated //when the current group is deleted, the current group has to be relocated
if(aGroupTLB.GetEntryCount()) if(m_pGroupTLB->GetEntryCount())
{ {
SvTreeListEntry* pFirst = aGroupTLB.First(); SvTreeListEntry* pFirst = m_pGroupTLB->First();
GlosBibUserData* pUserData = (GlosBibUserData*)pFirst->GetUserData(); GlosBibUserData* pUserData = (GlosBibUserData*)pFirst->GetUserData();
pGlosHdl->SetCurGroup(pUserData->sGroupName); pGlosHdl->SetCurGroup(pUserData->sGroupName);
} }
...@@ -192,55 +184,55 @@ void SwGlossaryGroupDlg::Apply() ...@@ -192,55 +184,55 @@ void SwGlossaryGroupDlg::Apply()
IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG ) IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG )
{ {
aNewPB.Enable(sal_False); m_pNewPB->Enable(sal_False);
SvTreeListEntry* pFirstEntry = aGroupTLB.FirstSelected(); SvTreeListEntry* pFirstEntry = m_pGroupTLB->FirstSelected();
if(pFirstEntry) if(pFirstEntry)
{ {
GlosBibUserData* pUserData = (GlosBibUserData*)pFirstEntry->GetUserData(); GlosBibUserData* pUserData = (GlosBibUserData*)pFirstEntry->GetUserData();
String sEntry(pUserData->sGroupName); String sEntry(pUserData->sGroupName);
String sName(aNameED.GetText()); String sName(m_pNameED->GetText());
sal_Bool bExists = sal_False; sal_Bool bExists = sal_False;
sal_uLong nPos = aGroupTLB.GetEntryPos(sName, 0); sal_uLong nPos = m_pGroupTLB->GetEntryPos(sName, 0);
if( 0xffffffff > nPos) if( 0xffffffff > nPos)
{ {
SvTreeListEntry* pEntry = aGroupTLB.GetEntry(nPos); SvTreeListEntry* pEntry = m_pGroupTLB->GetEntry(nPos);
GlosBibUserData* pFoundData = (GlosBibUserData*)pEntry->GetUserData(); GlosBibUserData* pFoundData = (GlosBibUserData*)pEntry->GetUserData();
String sGroup = pFoundData->sGroupName; String sGroup = pFoundData->sGroupName;
bExists = sGroup == sEntry; bExists = sGroup == sEntry;
} }
aRenamePB.Enable(!bExists && sName.Len()); m_pRenamePB->Enable(!bExists && sName.Len());
aDelPB.Enable(IsDeleteAllowed(sEntry)); m_pDelPB->Enable(IsDeleteAllowed(sEntry));
} }
return 0; return 0;
} }
IMPL_LINK_NOARG(SwGlossaryGroupDlg, NewHdl) IMPL_LINK_NOARG(SwGlossaryGroupDlg, NewHdl)
{ {
String sGroup(aNameED.GetText()); String sGroup(m_pNameED->GetText());
sGroup += GLOS_DELIM; sGroup += GLOS_DELIM;
sGroup += String::CreateFromInt32(aPathLB.GetSelectEntryPos()); sGroup += String::CreateFromInt32(m_pPathLB->GetSelectEntryPos());
OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!"); OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!");
m_InsertedArr.push_back(sGroup); m_InsertedArr.push_back(sGroup);
String sTemp(aNameED.GetText()); String sTemp(m_pNameED->GetText());
sTemp += '\t'; sTemp += '\t';
sTemp += aPathLB.GetSelectEntry(); sTemp += m_pPathLB->GetSelectEntry();
SvTreeListEntry* pEntry = aGroupTLB.InsertEntry(sTemp); SvTreeListEntry* pEntry = m_pGroupTLB->InsertEntry(sTemp);
GlosBibUserData* pData = new GlosBibUserData; GlosBibUserData* pData = new GlosBibUserData;
pData->sPath = aPathLB.GetSelectEntry(); pData->sPath = m_pPathLB->GetSelectEntry();
pData->sGroupName = sGroup; pData->sGroupName = sGroup;
pData->sGroupTitle = aNameED.GetText(); pData->sGroupTitle = m_pNameED->GetText();
pEntry->SetUserData(pData); pEntry->SetUserData(pData);
aGroupTLB.Select(pEntry); m_pGroupTLB->Select(pEntry);
aGroupTLB.MakeVisible(pEntry); m_pGroupTLB->MakeVisible(pEntry);
aGroupTLB.GetModel()->Resort(); m_pGroupTLB->GetModel()->Resort();
return 0; return 0;
} }
IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
{ {
SvTreeListEntry* pEntry = aGroupTLB.FirstSelected(); SvTreeListEntry* pEntry = m_pGroupTLB->FirstSelected();
if(!pEntry) if(!pEntry)
{ {
pButton->Enable(sal_False); pButton->Enable(sal_False);
...@@ -284,25 +276,25 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) ...@@ -284,25 +276,25 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
m_RemovedArr.push_back(sGroupEntry); m_RemovedArr.push_back(sGroupEntry);
} }
delete pUserData; delete pUserData;
aGroupTLB.GetModel()->Remove(pEntry); m_pGroupTLB->GetModel()->Remove(pEntry);
if(!aGroupTLB.First()) if(!m_pGroupTLB->First())
pButton->Enable(sal_False); pButton->Enable(sal_False);
//the content must be deleted - otherwise the new handler would be called in Apply() //the content must be deleted - otherwise the new handler would be called in Apply()
aNameED.SetText(aEmptyStr); m_pNameED->SetText(aEmptyStr);
return 0; return 0;
} }
IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl) IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl)
{ {
SvTreeListEntry* pEntry = aGroupTLB.FirstSelected(); SvTreeListEntry* pEntry = m_pGroupTLB->FirstSelected();
GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
String sEntry(pUserData->sGroupName); String sEntry(pUserData->sGroupName);
String sNewName(aNameED.GetText()); String sNewName(m_pNameED->GetText());
String sNewTitle(sNewName); String sNewTitle(sNewName);
sNewName += GLOS_DELIM; sNewName += GLOS_DELIM;
sNewName += String::CreateFromInt32(aPathLB.GetSelectEntryPos()); sNewName += String::CreateFromInt32(m_pPathLB->GetSelectEntryPos());
OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!"); OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!");
// if the name to be renamed is among the new ones - replace // if the name to be renamed is among the new ones - replace
...@@ -327,45 +319,45 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl) ...@@ -327,45 +319,45 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl)
m_RenamedArr.push_back(sEntry); m_RenamedArr.push_back(sEntry);
} }
delete (GlosBibUserData*)pEntry->GetUserData(); delete (GlosBibUserData*)pEntry->GetUserData();
aGroupTLB.GetModel()->Remove(pEntry); m_pGroupTLB->GetModel()->Remove(pEntry);
String sTemp(aNameED.GetText()); String sTemp(m_pNameED->GetText());
sTemp += '\t'; sTemp += '\t';
sTemp += aPathLB.GetSelectEntry(); sTemp += m_pPathLB->GetSelectEntry();
pEntry = aGroupTLB.InsertEntry(sTemp); pEntry = m_pGroupTLB->InsertEntry(sTemp);
GlosBibUserData* pData = new GlosBibUserData; GlosBibUserData* pData = new GlosBibUserData;
pData->sPath = aPathLB.GetSelectEntry(); pData->sPath = m_pPathLB->GetSelectEntry();
pData->sGroupName = sNewName; pData->sGroupName = sNewName;
pData->sGroupTitle = sNewTitle; pData->sGroupTitle = sNewTitle;
pEntry->SetUserData(pData); pEntry->SetUserData(pData);
aGroupTLB.Select(pEntry); m_pGroupTLB->Select(pEntry);
aGroupTLB.MakeVisible(pEntry); m_pGroupTLB->MakeVisible(pEntry);
aGroupTLB.GetModel()->Resort(); m_pGroupTLB->GetModel()->Resort();
return 0; return 0;
} }
IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl)
{ {
String sEntry(aNameED.GetText()); String sEntry(m_pNameED->GetText());
sal_Bool bEnableNew = sal_True; sal_Bool bEnableNew = sal_True;
sal_Bool bEnableDel = sal_False; sal_Bool bEnableDel = sal_False;
sal_uLong nCaseReadonly = sal_uLong nCaseReadonly =
(sal_uLong)aPathLB.GetEntryData(aPathLB.GetSelectEntryPos()); (sal_uLong)m_pPathLB->GetEntryData(m_pPathLB->GetSelectEntryPos());
sal_Bool bDirReadonly = 0 != (nCaseReadonly&PATH_READONLY); sal_Bool bDirReadonly = 0 != (nCaseReadonly&PATH_READONLY);
if(!sEntry.Len() || bDirReadonly) if(!sEntry.Len() || bDirReadonly)
bEnableNew = sal_False; bEnableNew = sal_False;
else if(sEntry.Len()) else if(sEntry.Len())
{ {
sal_uLong nPos = aGroupTLB.GetEntryPos(sEntry, 0); sal_uLong nPos = m_pGroupTLB->GetEntryPos(sEntry, 0);
//if it's not case sensitive you have to search for yourself //if it's not case sensitive you have to search for yourself
if( 0xffffffff == nPos) if( 0xffffffff == nPos)
{ {
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
for(sal_uInt16 i = 0; i < aGroupTLB.GetEntryCount(); i++) for(sal_uInt16 i = 0; i < m_pGroupTLB->GetEntryCount(); i++)
{ {
String sTemp = aGroupTLB.GetEntryText( i, 0 ); String sTemp = m_pGroupTLB->GetEntryText( i, 0 );
nCaseReadonly = (sal_uLong)aPathLB.GetEntryData( nCaseReadonly = (sal_uLong)m_pPathLB->GetEntryData(
aPathLB.GetEntryPos(aGroupTLB.GetEntryText(i,1))); m_pPathLB->GetEntryPos(m_pGroupTLB->GetEntryText(i,1)));
sal_Bool bCase = 0 != (nCaseReadonly & PATH_CASE_SENSITIVE); sal_Bool bCase = 0 != (nCaseReadonly & PATH_CASE_SENSITIVE);
if( !bCase && rSCmp.isEqual( sTemp, sEntry )) if( !bCase && rSCmp.isEqual( sTemp, sEntry ))
...@@ -378,20 +370,20 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) ...@@ -378,20 +370,20 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl)
if( 0xffffffff > nPos) if( 0xffffffff > nPos)
{ {
bEnableNew = sal_False; bEnableNew = sal_False;
aGroupTLB.Select(aGroupTLB.GetEntry( nPos )); m_pGroupTLB->Select(m_pGroupTLB->GetEntry( nPos ));
aGroupTLB.MakeVisible(aGroupTLB.GetEntry( nPos )); m_pGroupTLB->MakeVisible(m_pGroupTLB->GetEntry( nPos ));
} }
} }
SvTreeListEntry* pEntry = aGroupTLB.FirstSelected(); SvTreeListEntry* pEntry = m_pGroupTLB->FirstSelected();
if(pEntry) if(pEntry)
{ {
GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
bEnableDel = IsDeleteAllowed(pUserData->sGroupName); bEnableDel = IsDeleteAllowed(pUserData->sGroupName);
} }
aDelPB.Enable(bEnableDel); m_pDelPB->Enable(bEnableDel);
aNewPB.Enable(bEnableNew); m_pNewPB->Enable(bEnableNew);
aRenamePB.Enable(bEnableNew && pEntry); m_pRenamePB->Enable(bEnableNew && pEntry);
return 0; return 0;
} }
...@@ -426,6 +418,11 @@ void FEdit::KeyInput( const KeyEvent& rKEvent ) ...@@ -426,6 +418,11 @@ void FEdit::KeyInput( const KeyEvent& rKEvent )
Edit::KeyInput( rKEvent ); Edit::KeyInput( rKEvent );
} }
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFEdit(Window *pParent, VclBuilder::stringmap &)
{
return new FEdit(pParent);
}
void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt ) void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt )
{ {
Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
...@@ -457,4 +454,9 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt ) ...@@ -457,4 +454,9 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt )
} }
} }
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwGlossaryGroupTLB(Window *pParent, VclBuilder::stringmap &)
{
return new SwGlossaryGroupTLB(pParent);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#define FT_BIB 1
#define FT_PATH 2
#define FT_SELECT 3
#define CO_NAME 2
#define PB_NEW 3
#define PB_DELETE 4
#define BT_OK 5
#define BT_CANCEL 6
#define BT_HELP 7
#define LB_PATH 8
#define TLB_GROUPS 9
#define ED_NAME 10
#define PB_RENAME 11
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "glosbib.hrc"
#include "misc.hrc"
#include "helpid.h"
ModalDialog DLG_BIB_BASE
{
HelpID = HID_BIB_BASE ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 349 , 121 ) ;
Moveable = TRUE ;
Text [ en-US ] = "Edit Categories" ;
PushButton PB_NEW
{
HelpID = "sw:PushButton:DLG_BIB_BASE:PB_NEW";
Disable = TRUE ;
Pos = MAP_APPFONT ( 293 , 66 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~New" ;
TabStop = TRUE ;
};
PushButton PB_DELETE
{
HelpID = "sw:PushButton:DLG_BIB_BASE:PB_DELETE";
Pos = MAP_APPFONT ( 293 , 83 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete" ;
TabStop = TRUE ;
Disable = TRUE ;
};
PushButton PB_RENAME
{
HelpID = "sw:PushButton:DLG_BIB_BASE:PB_RENAME";
Disable = TRUE ;
Pos = MAP_APPFONT ( 293 , 100 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Rename" ;
TabStop = TRUE ;
};
FixedText FT_BIB
{
Pos = MAP_APPFONT ( 12 , 3 ) ;
Size = MAP_APPFONT ( 100 , 8 ) ;
Text [ en-US ] = "Category" ;
};
OKButton BT_OK
{
Pos = MAP_APPFONT ( 293 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BT_CANCEL
{
Pos = MAP_APPFONT ( 293 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BT_HELP
{
Pos = MAP_APPFONT ( 293 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
Edit ED_NAME
{
HelpID = "sw:Edit:DLG_BIB_BASE:ED_NAME";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 159 , 12 ) ;
TabStop = TRUE ;
Border = TRUE ;
MaxTextLength = 256 ;
};
FixedText FT_PATH
{
Pos = MAP_APPFONT ( 174 , 3 ) ;
Size = MAP_APPFONT ( 60 , 8 ) ;
Text [ en-US ] = "Path";
};
ListBox LB_PATH
{
HelpID = "sw:ListBox:DLG_BIB_BASE:LB_PATH";
Pos = MAP_APPFONT ( 174 , 14 ) ;
Size = MAP_APPFONT ( 107 , 50 ) ;
DropDown = TRUE ;
Border = TRUE ;
TabStop = TRUE ;
DDExtraWidth = TRUE ;
};
FixedText FT_SELECT
{
Pos = MAP_APPFONT ( 12 , 30 ) ;
Size = MAP_APPFONT ( 100 , 8 ) ;
Text [ en-US ] = "Selection list";
};
Control TLB_GROUPS
{
Pos = MAP_APPFONT ( 12 , 41 ) ;
Size = MAP_APPFONT ( 269 , 73 ) ;
TabStop = TRUE ;
Border = TRUE ;
};
/* ComboBox CO_NAME
{
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 89 , 76 ) ;
TabStop = TRUE ;
#ifdef WIN
MaxTextLength = 8 ;
#else
MaxTextLength = 32 ;
#endif
Sort = TRUE ;
};*/
};
/*
String STR_GLOSSARY_BIB_DLG
{
Text [ en-US ] = "Edit Categories" ;
};*/
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.0 --> <!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1"> <object class="GtkDialog" id="EditCategoriesDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <property name="border_width">5</property>
<object class="GtkBox" id="box1"> <property name="title" translatable="yes">Edit Categories</property>
<property name="visible">True</property> <property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <property name="spacing">2</property>
<object class="GtkGrid" id="grid1"> <child internal-child="action_area">
<property name="visible">True</property> <object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="row_spacing">8</property> <property name="orientation">vertical</property>
<child> <property name="layout_style">start</property>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">5</property>
<property name="column_spacing">10</property>
<child> <child>
<object class="GtkEntry" id="entry1"> <object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char"></property> <property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">1</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">0</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkComboBoxText" id="comboboxtext1"> <object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="entry_text_column">0</property> <property name="receives_default">True</property>
<property name="id_column">1</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="expand">False</property>
<property name="top_attach">1</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label1"> <object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">0</property> <property name="receives_default">True</property>
<property name="label" translatable="yes">Category</property> <property name="use_stock">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">0</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">2</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label2"> <object class="GtkButton" id="new">
<property name="label">gtk-new</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">0.46000000834465027</property> <property name="receives_default">True</property>
<property name="label" translatable="yes">Path</property> <property name="use_stock">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">0</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">3</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow1"> <object class="GtkButton" id="delete">
<property name="label">gtk-delete</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="receives_default">True</property>
<child> <property name="use_stock">True</property>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">2</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">4</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label3"> <object class="GtkButton" id="rename">
<property name="label" translatable="yes">_Rename</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Selection list</property> <property name="receives_default">True</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">1</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">5</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButtonBox" id="buttonbox1"> <object class="GtkGrid" id="grid1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="halign">start</property> <property name="hexpand">True</property>
<property name="valign">start</property> <property name="vexpand">True</property>
<property name="orientation">vertical</property> <property name="row_spacing">6</property>
<property name="spacing">5</property> <property name="column_spacing">12</property>
<property name="homogeneous">True</property> <property name="column_homogeneous">True</property>
<property name="layout_style">start</property>
<child> <child>
<object class="GtkButton" id="button1"> <object class="GtkLabel" id="label3">
<property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property> <property name="xalign">0</property>
<property name="use_action_appearance">False</property> <property name="label" translatable="yes">Selection list</property>
<property name="use_stock">True</property> <property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">2</property>
<property name="position">0</property> <property name="width">2</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button2"> <object class="swuilo:SwGlossaryGroupTLB" id="group">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property> <property name="hexpand">True</property>
<property name="use_action_appearance">False</property> <property name="vexpand">True</property>
<property name="use_stock">True</property> <property name="label" translatable="yes">label</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">3</property>
<property name="position">1</property> <property name="width">2</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button3"> <object class="GtkComboBoxText" id="pathlb">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property> <property name="hexpand">True</property>
<property name="use_action_appearance">False</property> <property name="entry_text_column">0</property>
<property name="use_stock">True</property> <property name="id_column">1</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">1</property>
<property name="fill">True</property> <property name="top_attach">1</property>
<property name="position">2</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button4"> <object class="GtkLabel" id="label2">
<property name="label">gtk-new</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property> <property name="xalign">0</property>
<property name="use_action_appearance">False</property> <property name="label" translatable="yes">Path</property>
<property name="use_stock">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">1</property>
<property name="fill">True</property> <property name="top_attach">0</property>
<property name="position">3</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="delete"> <object class="GtkLabel" id="label1">
<property name="label">gtk-delete</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property> <property name="xalign">0</property>
<property name="use_action_appearance">False</property> <property name="label" translatable="yes">Category</property>
<property name="use_stock">True</property> <property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">0</property>
<property name="position">4</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button6"> <object class="swuilo:FEdit" id="name">
<property name="label" translatable="yes">Rename</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="max_length">256</property>
<property name="use_action_appearance">False</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">1</property>
<property name="position">5</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -231,5 +214,13 @@ ...@@ -231,5 +214,13 @@
</child> </child>
</object> </object>
</child> </child>
<action-widgets>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="0">help</action-widget>
<action-widget response="0">new</action-widget>
<action-widget response="0">delete</action-widget>
<action-widget response="0">rename</action-widget>
</action-widgets>
</object> </object>
</interface> </interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment