Kaydet (Commit) 1611669c authored tarafından Manal Alhassoun's avatar Manal Alhassoun Kaydeden (comit) Caolán McNamara

fonttypedialog.ui widget

Change-Id: I4aac9046a004d84cd47d563aee8b7338e0d17896
Reviewed-on: https://gerrit.libreoffice.org/4697Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 052ad2cf
......@@ -15,6 +15,9 @@
-->
<glade-catalog name="LibreOffice" domain="glade-3" depends="gtk+" version="1.0">
<glade-widget-classes>
<glade-widget-class title="Font PickListBox" name="smlo-SmFontPickListBox"
generic-name="SmFontPickListBox" parent="GtkComboBoxText"
icon-name="widget-gtk-comboboxtext"/>
<glade-widget-class title="Thesaurus View" name="cuilo-ThesaurusAlternativesCtrl"
generic-name="ThesaurusAlternativesCtrl" parent="GtkTextView"
icon-name="widget-gtk-textview"/>
......
......@@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/smath,\
starmath/uiconfig/smath/ui/alignmentdialog \
starmath/uiconfig/smath/ui/catalogdialog \
starmath/uiconfig/smath/ui/fontsizedialog \
starmath/uiconfig/smath/ui/fonttypedialog \
starmath/uiconfig/smath/ui/printeroptions \
starmath/uiconfig/smath/ui/savedefaultsdialog \
starmath/uiconfig/smath/ui/smathsettings \
......
......@@ -142,27 +142,16 @@ public:
class SmFontTypeDialog : public ModalDialog
{
FixedText aFixedText1;
SmFontPickListBox aVariableFont;
FixedText aFixedText2;
SmFontPickListBox aFunctionFont;
FixedText aFixedText3;
SmFontPickListBox aNumberFont;
FixedText aFixedText4;
SmFontPickListBox aTextFont;
FixedText aFixedText5;
SmFontPickListBox aSerifFont;
FixedText aFixedText6;
SmFontPickListBox aSansFont;
FixedText aFixedText7;
SmFontPickListBox aFixedFont;
FixedLine aFixedLine1;
FixedLine aFixedLine2;
OKButton aOKButton1;
HelpButton aHelpButton1;
CancelButton aCancelButton1;
MenuButton aMenuButton;
PushButton aDefaultButton;
SmFontPickListBox* m_pVariableFont;
SmFontPickListBox* m_pFunctionFont;
SmFontPickListBox* m_pNumberFont;
SmFontPickListBox* m_pTextFont;
SmFontPickListBox* m_pSerifFont;
SmFontPickListBox* m_pSansFont;
SmFontPickListBox* m_pFixedFont;
HelpButton* m_pHelpButton1;
MenuButton* m_pMenuButton;
PushButton* m_pDefaultButton;
OutputDevice *pFontListDev;
......@@ -171,7 +160,7 @@ class SmFontTypeDialog : public ModalDialog
DECL_LINK(HelpButtonClickHdl, Button *);
public:
SmFontTypeDialog(Window *pParent, OutputDevice *pFntListDevice, bool bFreeRes = true);
SmFontTypeDialog(Window *pParent, OutputDevice *pFntListDevice);
void ReadFrom(const SmFormat &rFormat);
void WriteTo (SmFormat &rFormat) const;
......
......@@ -77,7 +77,6 @@
#define RID_FONTDIALOG (RID_APP_START + 2)
#define RID_FONTTYPEDIALOG (RID_APP_START + 4)
#define RID_SYMDEFINEDIALOG (RID_APP_START + 9)
#define RID_PRINTUIOPTIONS (RID_APP_START + 11)
......
......@@ -159,6 +159,7 @@ protected:
public:
SmFontPickListBox(Window* pParent, const ResId& rResId);
SmFontPickListBox (Window* pParent, WinBits nBits);
SmFontPickListBox& operator = (const SmFontPickList& rList);
......
......@@ -497,13 +497,13 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu )
bool bHideCheckboxes = false;
switch (pMenu->GetCurItemId())
{
case 1: pActiveListBox = &aVariableFont; break;
case 2: pActiveListBox = &aFunctionFont; break;
case 3: pActiveListBox = &aNumberFont; break;
case 4: pActiveListBox = &aTextFont; break;
case 5: pActiveListBox = &aSerifFont; bHideCheckboxes = true; break;
case 6: pActiveListBox = &aSansFont; bHideCheckboxes = true; break;
case 7: pActiveListBox = &aFixedFont; bHideCheckboxes = true; break;
case 1: pActiveListBox = m_pVariableFont; break;
case 2: pActiveListBox = m_pFunctionFont; break;
case 3: pActiveListBox = m_pNumberFont; break;
case 4: pActiveListBox = m_pTextFont; break;
case 5: pActiveListBox = m_pSerifFont; bHideCheckboxes = true; break;
case 6: pActiveListBox = m_pSansFont; bHideCheckboxes = true; break;
case 7: pActiveListBox = m_pFixedFont; bHideCheckboxes = true; break;
default:pActiveListBox = NULL;
}
......@@ -539,64 +539,51 @@ IMPL_LINK( SmFontTypeDialog, HelpButtonClickHdl, Button *, EMPTYARG /*pButton*/
Help* pHelp = Application::GetHelp();
if( pHelp )
{
pHelp->Start( OUString( "HID_SMA_FONTTYPEDIALOG" ), &aHelpButton1 );
pHelp->Start( OUString( "HID_SMA_FONTTYPEDIALOG" ), m_pHelpButton1 );
}
return 0;
}
SmFontTypeDialog::SmFontTypeDialog(Window * pParent, OutputDevice *pFntListDevice, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_FONTTYPEDIALOG)),
aFixedText1 (this, SmResId(1)),
aVariableFont (this, SmResId(1)),
aFixedText2 (this, SmResId(2)),
aFunctionFont (this, SmResId(2)),
aFixedText3 (this, SmResId(3)),
aNumberFont (this, SmResId(3)),
aFixedText4 (this, SmResId(4)),
aTextFont (this, SmResId(4)),
aFixedText5 (this, SmResId(5)),
aSerifFont (this, SmResId(5)),
aFixedText6 (this, SmResId(6)),
aSansFont (this, SmResId(6)),
aFixedText7 (this, SmResId(7)),
aFixedFont (this, SmResId(7)),
aFixedLine1 (this, SmResId(1)),
aFixedLine2 (this, SmResId(2)),
aOKButton1 (this, SmResId(1)),
aHelpButton1 (this, SmResId(1)),
aCancelButton1 (this, SmResId(1)),
aMenuButton (this, SmResId(1)),
aDefaultButton (this, SmResId(2)),
SmFontTypeDialog::SmFontTypeDialog(Window * pParent, OutputDevice *pFntListDevice)
: ModalDialog(pParent, "FontsDialog", "modules/smath/ui/fonttypedialog.ui"),
pFontListDev (pFntListDevice)
{
if (bFreeRes)
FreeResource();
get(m_pVariableFont, "variableCB");
get(m_pFunctionFont, "functionCB");
get(m_pNumberFont, "numberCB");
get(m_pTextFont, "textCB");
get(m_pSerifFont, "serifCB");
get(m_pSansFont, "sansCB");
get(m_pFixedFont, "fixedCB");
get(m_pHelpButton1, "help");
get(m_pMenuButton, "modify");
get(m_pDefaultButton, "default");
aDefaultButton.SetClickHdl(LINK(this, SmFontTypeDialog, DefaultButtonClickHdl));
aHelpButton1.SetClickHdl(LINK(this, SmFontTypeDialog, HelpButtonClickHdl));
m_pDefaultButton->SetClickHdl(LINK(this, SmFontTypeDialog, DefaultButtonClickHdl));
m_pHelpButton1->SetClickHdl(LINK(this, SmFontTypeDialog, HelpButtonClickHdl));
aMenuButton.GetPopupMenu()->SetSelectHdl(LINK(this, SmFontTypeDialog, MenuSelectHdl));
m_pMenuButton->GetPopupMenu()->SetSelectHdl(LINK(this, SmFontTypeDialog, MenuSelectHdl));
}
void SmFontTypeDialog::ReadFrom(const SmFormat &rFormat)
{
SmModule *pp = SM_MOD();
aVariableFont = pp->GetConfig()->GetFontPickList(FNT_VARIABLE);
aFunctionFont = pp->GetConfig()->GetFontPickList(FNT_FUNCTION);
aNumberFont = pp->GetConfig()->GetFontPickList(FNT_NUMBER);
aTextFont = pp->GetConfig()->GetFontPickList(FNT_TEXT);
aSerifFont = pp->GetConfig()->GetFontPickList(FNT_SERIF);
aSansFont = pp->GetConfig()->GetFontPickList(FNT_SANS);
aFixedFont = pp->GetConfig()->GetFontPickList(FNT_FIXED);
*m_pVariableFont = pp->GetConfig()->GetFontPickList(FNT_VARIABLE);
*m_pFunctionFont = pp->GetConfig()->GetFontPickList(FNT_FUNCTION);
*m_pNumberFont = pp->GetConfig()->GetFontPickList(FNT_NUMBER);
*m_pTextFont = pp->GetConfig()->GetFontPickList(FNT_TEXT);
*m_pSerifFont = pp->GetConfig()->GetFontPickList(FNT_SERIF);
*m_pSansFont = pp->GetConfig()->GetFontPickList(FNT_SANS);
*m_pFixedFont = pp->GetConfig()->GetFontPickList(FNT_FIXED);
aVariableFont.Insert( rFormat.GetFont(FNT_VARIABLE) );
aFunctionFont.Insert( rFormat.GetFont(FNT_FUNCTION) );
aNumberFont .Insert( rFormat.GetFont(FNT_NUMBER) );
aTextFont .Insert( rFormat.GetFont(FNT_TEXT) );
aSerifFont .Insert( rFormat.GetFont(FNT_SERIF) );
aSansFont .Insert( rFormat.GetFont(FNT_SANS) );
aFixedFont .Insert( rFormat.GetFont(FNT_FIXED) );
m_pVariableFont->Insert( rFormat.GetFont(FNT_VARIABLE) );
m_pFunctionFont->Insert( rFormat.GetFont(FNT_FUNCTION) );
m_pNumberFont->Insert( rFormat.GetFont(FNT_NUMBER) );
m_pTextFont->Insert( rFormat.GetFont(FNT_TEXT) );
m_pSerifFont->Insert( rFormat.GetFont(FNT_SERIF) );
m_pSansFont->Insert( rFormat.GetFont(FNT_SANS) );
m_pFixedFont->Insert( rFormat.GetFont(FNT_FIXED) );
}
......@@ -604,21 +591,21 @@ void SmFontTypeDialog::WriteTo(SmFormat &rFormat) const
{
SmModule *pp = SM_MOD();
pp->GetConfig()->GetFontPickList(FNT_VARIABLE) = aVariableFont;
pp->GetConfig()->GetFontPickList(FNT_FUNCTION) = aFunctionFont;
pp->GetConfig()->GetFontPickList(FNT_NUMBER) = aNumberFont;
pp->GetConfig()->GetFontPickList(FNT_TEXT) = aTextFont;
pp->GetConfig()->GetFontPickList(FNT_SERIF) = aSerifFont;
pp->GetConfig()->GetFontPickList(FNT_SANS) = aSansFont;
pp->GetConfig()->GetFontPickList(FNT_FIXED) = aFixedFont;
rFormat.SetFont( FNT_VARIABLE, aVariableFont.Get(0) );
rFormat.SetFont( FNT_FUNCTION, aFunctionFont.Get(0) );
rFormat.SetFont( FNT_NUMBER, aNumberFont .Get(0) );
rFormat.SetFont( FNT_TEXT, aTextFont .Get(0) );
rFormat.SetFont( FNT_SERIF, aSerifFont .Get(0) );
rFormat.SetFont( FNT_SANS, aSansFont .Get(0) );
rFormat.SetFont( FNT_FIXED, aFixedFont .Get(0) );
pp->GetConfig()->GetFontPickList(FNT_VARIABLE) = *m_pVariableFont;
pp->GetConfig()->GetFontPickList(FNT_FUNCTION) = *m_pFunctionFont;
pp->GetConfig()->GetFontPickList(FNT_NUMBER) = *m_pNumberFont;
pp->GetConfig()->GetFontPickList(FNT_TEXT) = *m_pTextFont;
pp->GetConfig()->GetFontPickList(FNT_SERIF) = *m_pSerifFont;
pp->GetConfig()->GetFontPickList(FNT_SANS) = *m_pSansFont;
pp->GetConfig()->GetFontPickList(FNT_FIXED) = *m_pFixedFont;
rFormat.SetFont( FNT_VARIABLE, m_pVariableFont->Get(0) );
rFormat.SetFont( FNT_FUNCTION, m_pFunctionFont->Get(0) );
rFormat.SetFont( FNT_NUMBER, m_pNumberFont->Get(0) );
rFormat.SetFont( FNT_TEXT, m_pTextFont->Get(0) );
rFormat.SetFont( FNT_SERIF, m_pSerifFont->Get(0) );
rFormat.SetFont( FNT_SANS, m_pSansFont->Get(0) );
rFormat.SetFont( FNT_FIXED, m_pFixedFont->Get(0) );
rFormat.RequestApplyChanges();
}
......
......@@ -104,177 +104,6 @@ ModalDialog RID_FONTDIALOG
};
};
ModalDialog RID_FONTTYPEDIALOG
{
OutputSize = TRUE ;
SVLook = TRUE ;
HelpId = CMD_SID_FONT ;
Size = MAP_APPFONT ( 282 , 153 ) ;
Text [ en-US ] = "Fonts" ;
Moveable = TRUE ;
FixedLine 1
{
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 207 , 8 ) ;
Text [ en-US ] = "Formula fonts" ;
};
FixedLine 2
{
Pos = MAP_APPFONT ( 6 , 84 ) ;
Size = MAP_APPFONT ( 207 , 8 ) ;
Text [ en-US ] = "Custom fonts" ;
};
FixedText 1
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 18 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "~Variables";
};
ListBox 1
{
HelpID = "starmath:ListBox:RID_FONTTYPEDIALOG:1";
Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 18 ) ;
Size = MAP_APPFONT ( 150 , 69 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText 2
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 33 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "~Functions";
};
ListBox 2
{
HelpID = "starmath:ListBox:RID_FONTTYPEDIALOG:2";
Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 33 ) ;
Size = MAP_APPFONT ( 150 , 69 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText 3
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 51 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "~Numbers";
};
ListBox 3
{
HelpID = "starmath:ListBox:RID_FONTTYPEDIALOG:3";
Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 48 ) ;
Size = MAP_APPFONT ( 150 , 69 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText 4
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 66 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "~Text";
};
ListBox 4
{
HelpID = "starmath:ListBox:RID_FONTTYPEDIALOG:4";
Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 63 ) ;
Size = MAP_APPFONT ( 150 , 69 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText 5
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 97 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "~Serif";
};
ListBox 5
{
HelpID = "starmath:ListBox:RID_FONTTYPEDIALOG:5";
Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 96 ) ;
Size = MAP_APPFONT ( 150 , 69 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText 6
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 112 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "S~ans";
};
ListBox 6
{
HelpID = "starmath:ListBox:RID_FONTTYPEDIALOG:6";
Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 111 ) ;
Size = MAP_APPFONT ( 150 , 69 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText 7
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 127 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "F~ixed";
};
ListBox 7
{
HelpID = "starmath:ListBox:RID_FONTTYPEDIALOG:7";
Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 126 ) ;
Size = MAP_APPFONT ( 150 , 69 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
};
OKButton 1
{
Pos = MAP_APPFONT ( 225 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton 1
{
Pos = MAP_APPFONT ( 225 , 24 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
MenuButton 1
{
HelpID = "starmath:MenuButton:RID_FONTTYPEDIALOG:1";
TabStop = TRUE ;
ButtonMenu = Menu , RID_FONTMENU ;
Pos = MAP_APPFONT ( 225 , 48 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Modify" ;
};
HelpButton 1
{
Pos = MAP_APPFONT ( 225 , 66 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:HelpButton:RID_FONTYPEDIALOG:1";
Text [ en-US ] = "~Help" ;
};
PushButton 2
{
HelpID = "starmath:PushButton:RID_FONTTYPEDIALOG:2";
TabStop = TRUE ;
Pos = MAP_APPFONT ( 225 , 84 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Default" ;
};
};
ModalDialog RID_SYMDEFINEDIALOG
{
......
......@@ -155,6 +155,17 @@ void SmFontPickList::WriteTo(SmFontDialog& rDialog) const
/**************************************************************************/
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSmFontPickListBox(Window* pParent, VclBuilder::stringmap &)
{
return new SmFontPickListBox(pParent, WB_DROPDOWN);
}
SmFontPickListBox::SmFontPickListBox (Window* pParent, WinBits nBits) :
SmFontPickList(4),
ListBox(pParent, nBits)
{
SetSelectHdl(LINK(this, SmFontPickListBox, SelectHdl));
}
IMPL_LINK( SmFontPickListBox, SelectHdl, ListBox *, /*pListBox*/ )
{
......
This diff is collapsed.
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