adapt code to New Toolbar Dialog .ui conversion
Change-Id: Ie1b7a0cf5fbb9dbfc04a07bb58d5f55f83a096f3
This commit is contained in:
parent
7d7eb08e18
commit
6fb6bc4b4e
6 changed files with 38 additions and 102 deletions
|
@ -27,6 +27,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
|
|||
cui/uiconfig/ui/messbox \
|
||||
cui/uiconfig/ui/namedialog \
|
||||
cui/uiconfig/ui/newtabledialog \
|
||||
cui/uiconfig/ui/newtoolbardialog \
|
||||
cui/uiconfig/ui/numberingformatpage \
|
||||
cui/uiconfig/ui/numberingoptionspage \
|
||||
cui/uiconfig/ui/numberingpositionpage \
|
||||
|
|
|
@ -4653,24 +4653,24 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton )
|
|||
SaveInData* pData =
|
||||
(SaveInData*) aSaveInListBox.GetEntryData( i );
|
||||
|
||||
nInsertPos = pNameDialog->aSaveInListBox.InsertEntry(
|
||||
nInsertPos = pNameDialog->m_pSaveInListBox->InsertEntry(
|
||||
aSaveInListBox.GetEntry( i ) );
|
||||
|
||||
pNameDialog->aSaveInListBox.SetEntryData( nInsertPos, pData );
|
||||
pNameDialog->m_pSaveInListBox->SetEntryData( nInsertPos, pData );
|
||||
}
|
||||
|
||||
pNameDialog->aSaveInListBox.SelectEntryPos(
|
||||
pNameDialog->m_pSaveInListBox->SelectEntryPos(
|
||||
aSaveInListBox.GetSelectEntryPos(), sal_True );
|
||||
|
||||
bool ret = pNameDialog->Execute();
|
||||
if ( ret == RET_OK )
|
||||
{
|
||||
pNameDialog->GetName( aNewName );
|
||||
aNewName = pNameDialog->GetName();
|
||||
|
||||
nInsertPos = pNameDialog->aSaveInListBox.GetSelectEntryPos();
|
||||
nInsertPos = pNameDialog->m_pSaveInListBox->GetSelectEntryPos();
|
||||
|
||||
ToolbarSaveInData* pData = (ToolbarSaveInData*)
|
||||
pNameDialog->aSaveInListBox.GetEntryData( nInsertPos );
|
||||
pNameDialog->m_pSaveInListBox->GetEntryData( nInsertPos );
|
||||
|
||||
if ( GetSaveInData() != pData )
|
||||
{
|
||||
|
@ -4954,24 +4954,16 @@ sal_Bool SvxToolbarEntriesListBox::NotifyCopying(
|
|||
return sal_False;
|
||||
}
|
||||
|
||||
SvxNewToolbarDialog::SvxNewToolbarDialog(
|
||||
Window* pWindow, const String& rName )
|
||||
:
|
||||
ModalDialog ( pWindow, CUI_RES( MD_NEW_TOOLBAR ) ),
|
||||
aFtDescription ( this, CUI_RES( FT_NAME ) ),
|
||||
aEdtName ( this, CUI_RES( EDT_STRING ) ),
|
||||
aSaveInText ( this, CUI_RES( TXT_SAVEIN ) ),
|
||||
aBtnOK ( this, CUI_RES( BTN_OK ) ),
|
||||
aBtnCancel ( this, CUI_RES( BTN_CANCEL ) ),
|
||||
aBtnHelp ( this, CUI_RES( BTN_HELP ) ),
|
||||
aSaveInListBox ( this, CUI_RES( LB_SAVEIN ) )
|
||||
SvxNewToolbarDialog::SvxNewToolbarDialog(Window* pWindow, const OUString& rName)
|
||||
: ModalDialog(pWindow, "NewToolbarDialog", "cui/ui/newtoolbardialog.ui")
|
||||
{
|
||||
FreeResource();
|
||||
|
||||
aEdtName.SetText( rName );
|
||||
aEdtName.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
|
||||
ModifyHdl(&aEdtName);
|
||||
aEdtName.SetModifyHdl(LINK(this, SvxNewToolbarDialog, ModifyHdl));
|
||||
get(m_pEdtName, "edit");
|
||||
get(m_pBtnOK, "ok");
|
||||
get(m_pSaveInListBox, "savein");
|
||||
m_pEdtName->SetText( rName );
|
||||
m_pEdtName->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
|
||||
ModifyHdl(m_pEdtName);
|
||||
m_pEdtName->SetModifyHdl(LINK(this, SvxNewToolbarDialog, ModifyHdl));
|
||||
}
|
||||
|
||||
IMPL_LINK(SvxNewToolbarDialog, ModifyHdl, Edit*, pEdit)
|
||||
|
@ -4979,7 +4971,7 @@ IMPL_LINK(SvxNewToolbarDialog, ModifyHdl, Edit*, pEdit)
|
|||
(void)pEdit;
|
||||
|
||||
if(aCheckNameHdl.IsSet())
|
||||
aBtnOK.Enable(aCheckNameHdl.Call(this) > 0);
|
||||
m_pBtnOK->Enable(aCheckNameHdl.Call(this) > 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -79,12 +79,9 @@
|
|||
#define BTN_IMPORT (97 + CFG_OFFSET)
|
||||
#define IMAGE_BTN_COLOR (98 + CFG_OFFSET)
|
||||
|
||||
#define MD_NEW_TOOLBAR (101 + CFG_OFFSET)
|
||||
#define EDT_STRING (102 + CFG_OFFSET)
|
||||
#define BTN_OK (103 + CFG_OFFSET)
|
||||
#define BTN_CANCEL (104 + CFG_OFFSET)
|
||||
#define BTN_HELP (105 + CFG_OFFSET)
|
||||
#define FT_NAME (106 + CFG_OFFSET)
|
||||
|
||||
#define FL_SEPARATOR (108 + CFG_OFFSET)
|
||||
#define BTN_DELETE (109 + CFG_OFFSET)
|
||||
|
|
|
@ -483,66 +483,6 @@ ModalDialog MD_MENU_ORGANISER
|
|||
};
|
||||
};
|
||||
|
||||
// MD_NEW_TOOLBAR -------------------------------------------------
|
||||
ModalDialog MD_NEW_TOOLBAR
|
||||
{
|
||||
HelpID = "cui:ModalDialog:MD_NEW_TOOLBAR";
|
||||
OutputSize = TRUE ;
|
||||
SvLook = TRUE ;
|
||||
Size = MAP_APPFONT ( 165 , 63 ) ;
|
||||
Text [ en-US ] = "Name" ;
|
||||
Moveable = TRUE ;
|
||||
FixedText FT_NAME
|
||||
{
|
||||
Pos = MAP_APPFONT ( 6 , 6 ) ;
|
||||
Size = MAP_APPFONT ( 98 , 8 ) ;
|
||||
TEXT_TOOLBAR_NAME
|
||||
WordBreak = TRUE ;
|
||||
};
|
||||
Edit EDT_STRING
|
||||
{
|
||||
HelpID = "cui:Edit:MD_NEW_TOOLBAR:EDT_STRING";
|
||||
Border = TRUE ;
|
||||
Pos = MAP_APPFONT ( 6 , 17 ) ;
|
||||
Size = MAP_APPFONT ( 97 , 12 ) ;
|
||||
TabStop = TRUE ;
|
||||
};
|
||||
FixedText TXT_SAVEIN
|
||||
{
|
||||
Pos = MAP_APPFONT ( 6 , 35 ) ;
|
||||
Size = MAP_APPFONT ( 98 , 8 ) ;
|
||||
Group = TRUE ;
|
||||
TEXT_SAVE_IN
|
||||
};
|
||||
ListBox LB_SAVEIN
|
||||
{
|
||||
HelpID = "cui:ListBox:MD_NEW_TOOLBAR:LB_SAVEIN";
|
||||
Border = TRUE ;
|
||||
Pos = MAP_APPFONT ( 6 , 43 ) ;
|
||||
Size = MAP_APPFONT ( 97 , 53 ) ;
|
||||
DropDown = TRUE ;
|
||||
};
|
||||
OKButton BTN_OK
|
||||
{
|
||||
Pos = MAP_APPFONT ( 109 , 6 ) ;
|
||||
Size = MAP_APPFONT ( 50 , 14 ) ;
|
||||
TabStop = TRUE ;
|
||||
DefButton = TRUE ;
|
||||
};
|
||||
CancelButton BTN_CANCEL
|
||||
{
|
||||
Pos = MAP_APPFONT ( 109 , 23 ) ;
|
||||
Size = MAP_APPFONT ( 50 , 14 ) ;
|
||||
TabStop = TRUE ;
|
||||
};
|
||||
HelpButton BTN_HELP
|
||||
{
|
||||
Pos = MAP_APPFONT ( 109 , 43 ) ;
|
||||
Size = MAP_APPFONT ( 50 , 14 ) ;
|
||||
TabStop = TRUE ;
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef IMAGE_STDBTN_COLOR
|
||||
#define IMAGE_STDBTN_COLOR Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
|
||||
#endif
|
||||
|
|
|
@ -684,32 +684,34 @@ public:
|
|||
class SvxNewToolbarDialog : public ModalDialog
|
||||
{
|
||||
private:
|
||||
FixedText aFtDescription;
|
||||
Edit aEdtName;
|
||||
FixedText aSaveInText;
|
||||
OKButton aBtnOK;
|
||||
CancelButton aBtnCancel;
|
||||
HelpButton aBtnHelp;
|
||||
Edit* m_pEdtName;
|
||||
OKButton* m_pBtnOK;
|
||||
|
||||
Link aCheckNameHdl;
|
||||
|
||||
DECL_LINK(ModifyHdl, Edit*);
|
||||
|
||||
public:
|
||||
SvxNewToolbarDialog( Window* pWindow, const String& rName );
|
||||
SvxNewToolbarDialog(Window* pWindow, const OUString& rName);
|
||||
|
||||
ListBox aSaveInListBox;
|
||||
ListBox* m_pSaveInListBox;
|
||||
|
||||
void GetName( rtl::OUString& rName ){rName = aEdtName.GetText();}
|
||||
OUString GetName()
|
||||
{
|
||||
return m_pEdtName->GetText();
|
||||
}
|
||||
|
||||
void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false )
|
||||
void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false )
|
||||
{
|
||||
aCheckNameHdl = rLink;
|
||||
if ( bCheckImmediately )
|
||||
aBtnOK.Enable( rLink.Call( this ) > 0 );
|
||||
m_pBtnOK->Enable( rLink.Call( this ) > 0 );
|
||||
}
|
||||
|
||||
void SetEditHelpId( const rtl::OString& aHelpId) {aEdtName.SetHelpId(aHelpId);}
|
||||
void SetEditHelpId( const rtl::OString& aHelpId)
|
||||
{
|
||||
m_pEdtName->SetHelpId(aHelpId);
|
||||
}
|
||||
};
|
||||
|
||||
class SvxIconSelectorDialog : public ModalDialog
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<object class="GtkAction" id="action1"/>
|
||||
<object class="GtkDialog" id="NewToolbarDialog">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
|
@ -21,6 +20,8 @@
|
|||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</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>
|
||||
|
@ -87,6 +88,7 @@
|
|||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Toolbar Name</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">edit</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -95,10 +97,11 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<object class="GtkEntry" id="edit">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="width_chars">26</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -126,6 +129,7 @@
|
|||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Save In</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">savein</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -134,7 +138,7 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="comboboxtext1">
|
||||
<object class="GtkComboBoxText" id="savein">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="entry_text_column">0</property>
|
Loading…
Reference in a new issue