diff options
author | Manal Alhassoun <malhassoun@kacst.edu.sa> | 2013-07-03 13:20:16 +0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-03 12:59:05 +0000 |
commit | 1611669c400a87e6a092e6312fd83b4f9f89257b (patch) | |
tree | c08721b7dde0ab123ad6a461028af12f3edbe1f6 /starmath/source | |
parent | 052ad2cf198aa27eb1719be1864477119c6576e9 (diff) |
fonttypedialog.ui widget
Change-Id: I4aac9046a004d84cd47d563aee8b7338e0d17896
Reviewed-on: https://gerrit.libreoffice.org/4697
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/dialog.cxx | 117 | ||||
-rw-r--r-- | starmath/source/smres.src | 171 | ||||
-rw-r--r-- | starmath/source/utility.cxx | 11 |
3 files changed, 63 insertions, 236 deletions
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 984461d091da..b42a278bdce4 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -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(); } diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 73d3d4cdf6f3..de4427f20da2 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -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 { diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx index 1d450ecb0475..4583c539df33 100644 --- a/starmath/source/utility.cxx +++ b/starmath/source/utility.cxx @@ -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*/ ) { |