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

fontsizedialog.ui widget

Change-Id: I1c91b4c621c5a2da11cebdd8e58a5e5d0d86bf6c
üst 02da9f7a
......@@ -26,6 +26,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/smath,\
$(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/printeroptions \
starmath/uiconfig/smath/ui/savedefaultsdialog \
starmath/uiconfig/smath/ui/smathsettings \
......
......@@ -121,29 +121,20 @@ public:
class SmFontSizeDialog : public ModalDialog
{
FixedText aFixedText1;
MetricField aBaseSize;
FixedText aFixedText4;
MetricField aTextSize;
FixedText aFixedText5;
MetricField aIndexSize;
FixedText aFixedText6;
MetricField aFunctionSize;
FixedText aFixedText7;
MetricField aOperatorSize;
FixedText aFixedText8;
MetricField aBorderSize;
FixedLine aFixedLine1;
OKButton aOKButton1;
HelpButton aHelpButton1;
CancelButton aCancelButton1;
PushButton aDefaultButton;
MetricField* m_pBaseSize;
MetricField* m_pTextSize;
MetricField* m_pIndexSize;
MetricField* m_pFunctionSize;
MetricField* m_pOperatorSize;
MetricField* m_pBorderSize;
HelpButton* m_pHelpButton1;
PushButton* m_pDefaultButton;
DECL_LINK(DefaultButtonClickHdl, Button *);
DECL_LINK(HelpButtonClickHdl, Button *);
public:
SmFontSizeDialog(Window *pParent, bool bFreeRes = true);
SmFontSizeDialog(Window *pParent);
void ReadFrom(const SmFormat &rFormat);
void WriteTo (SmFormat &rFormat) const;
......
......@@ -77,7 +77,6 @@
#define RID_FONTDIALOG (RID_APP_START + 2)
#define RID_FONTSIZEDIALOG (RID_APP_START + 3)
#define RID_FONTTYPEDIALOG (RID_APP_START + 4)
#define RID_SYMDEFINEDIALOG (RID_APP_START + 9)
#define RID_PRINTUIOPTIONS (RID_APP_START + 11)
......
......@@ -446,62 +446,51 @@ IMPL_LINK( SmFontSizeDialog, HelpButtonClickHdl, Button *, EMPTYARG /*pButton*/
Help* pHelp = Application::GetHelp();
if( pHelp )
{
pHelp->Start( OUString( "HID_SMA_FONTSIZEDIALOG" ), &aHelpButton1 );
pHelp->Start( OUString( "HID_SMA_FONTSIZEDIALOG" ), m_pHelpButton1 );
}
return 0;
}
SmFontSizeDialog::SmFontSizeDialog(Window * pParent, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_FONTSIZEDIALOG)),
aFixedText1(this, SmResId(1)),
aBaseSize(this, SmResId(1)),
aFixedText4(this, SmResId(4)),
aTextSize(this, SmResId(4)),
aFixedText5(this, SmResId(5)),
aIndexSize(this, SmResId(5)),
aFixedText6(this, SmResId(6)),
aFunctionSize(this, SmResId(6)),
aFixedText7(this, SmResId(7)),
aOperatorSize(this, SmResId(7)),
aFixedText8(this, SmResId(8)),
aBorderSize(this, SmResId(8)),
aFixedLine1(this, SmResId(1)),
aOKButton1(this, SmResId(1)),
aHelpButton1(this, SmResId(1)),
aCancelButton1(this, SmResId(1)),
aDefaultButton(this, SmResId(1))
SmFontSizeDialog::SmFontSizeDialog(Window * pParent)
: ModalDialog(pParent, "FontSizeDialog", "modules/smath/ui/fontsizedialog.ui")
{
if (bFreeRes)
FreeResource();
get(m_pTextSize, "spinB_text");
get(m_pIndexSize, "spinB_index");
get(m_pFunctionSize, "spinB_function");
get(m_pOperatorSize, "spinB_operator");
get(m_pBorderSize, "spinB_limit");
get(m_pBaseSize, "spinB_baseSize");
get(m_pHelpButton1, "help");
get(m_pDefaultButton, "default");
aDefaultButton.SetClickHdl(LINK(this, SmFontSizeDialog, DefaultButtonClickHdl));
aHelpButton1.SetClickHdl(LINK(this, SmFontSizeDialog, HelpButtonClickHdl));
m_pDefaultButton->SetClickHdl(LINK(this, SmFontSizeDialog, DefaultButtonClickHdl));
m_pHelpButton1->SetClickHdl(LINK(this, SmFontSizeDialog, HelpButtonClickHdl));
}
void SmFontSizeDialog::ReadFrom(const SmFormat &rFormat)
{
//! aufpassen: richtig runden!
aBaseSize.SetValue( SmRoundFraction(
m_pBaseSize->SetValue( SmRoundFraction(
Sm100th_mmToPts( rFormat.GetBaseSize().Height() ) ) );
aTextSize .SetValue( rFormat.GetRelSize(SIZ_TEXT) );
aIndexSize .SetValue( rFormat.GetRelSize(SIZ_INDEX) );
aFunctionSize.SetValue( rFormat.GetRelSize(SIZ_FUNCTION) );
aOperatorSize.SetValue( rFormat.GetRelSize(SIZ_OPERATOR) );
aBorderSize .SetValue( rFormat.GetRelSize(SIZ_LIMITS) );
m_pTextSize->SetValue( rFormat.GetRelSize(SIZ_TEXT) );
m_pIndexSize->SetValue( rFormat.GetRelSize(SIZ_INDEX) );
m_pFunctionSize->SetValue( rFormat.GetRelSize(SIZ_FUNCTION) );
m_pOperatorSize->SetValue( rFormat.GetRelSize(SIZ_OPERATOR) );
m_pBorderSize->SetValue( rFormat.GetRelSize(SIZ_LIMITS) );
}
void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const
{
rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm( static_cast< long >(aBaseSize.GetValue()))) );
rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm( static_cast< long >(m_pBaseSize->GetValue()))) );
rFormat.SetRelSize(SIZ_TEXT, (sal_uInt16) aTextSize .GetValue());
rFormat.SetRelSize(SIZ_INDEX, (sal_uInt16) aIndexSize .GetValue());
rFormat.SetRelSize(SIZ_FUNCTION, (sal_uInt16) aFunctionSize.GetValue());
rFormat.SetRelSize(SIZ_OPERATOR, (sal_uInt16) aOperatorSize.GetValue());
rFormat.SetRelSize(SIZ_LIMITS, (sal_uInt16) aBorderSize .GetValue());
rFormat.SetRelSize(SIZ_TEXT, (sal_uInt16) m_pTextSize->GetValue());
rFormat.SetRelSize(SIZ_INDEX, (sal_uInt16) m_pIndexSize->GetValue());
rFormat.SetRelSize(SIZ_FUNCTION, (sal_uInt16) m_pFunctionSize->GetValue());
rFormat.SetRelSize(SIZ_OPERATOR, (sal_uInt16) m_pOperatorSize->GetValue());
rFormat.SetRelSize(SIZ_LIMITS, (sal_uInt16) m_pBorderSize->GetValue());
const Size aTmp (rFormat.GetBaseSize());
for (sal_uInt16 i = FNT_BEGIN; i <= FNT_END; i++)
......
......@@ -104,182 +104,6 @@ ModalDialog RID_FONTDIALOG
};
};
ModalDialog RID_FONTSIZEDIALOG
{
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
HelpId = CMD_SID_FONTSIZE ;
Size = MAP_APPFONT ( 171 , 120 ) ;
Text [ en-US ] = "Font Sizes" ;
FixedText 1
{
Left = TRUE ;
Pos = MAP_APPFONT ( 12 , 7 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Text [ en-US ] = "Base ~size";
};
MetricField 1
{
HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:1";
Border = TRUE ;
Pos = MAP_APPFONT ( 57 , 6 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 4 ;
Maximum = 127 ;
Unit = FUNIT_POINT ;
};
FixedText 4
{
Pos = MAP_APPFONT ( 12 , 37 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Left = TRUE ;
Text [ en-US ] = "~Text";
};
MetricField 4
{
HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:4";
Border = TRUE ;
Pos = MAP_APPFONT ( 57 , 36 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 5 ;
Maximum = 200 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
};
FixedText 5
{
Pos = MAP_APPFONT ( 12 , 52 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Left = TRUE ;
Text [ en-US ] = "~Indexes";
};
MetricField 5
{
HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:5";
Border = TRUE ;
Pos = MAP_APPFONT ( 57 , 51 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 5 ;
Maximum = 200 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
};
FixedText 6
{
Pos = MAP_APPFONT ( 12 , 67 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Left = TRUE ;
Text [ en-US ] = "~Functions";
};
MetricField 6
{
HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:6";
Border = TRUE ;
Pos = MAP_APPFONT ( 57 , 66 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 5 ;
Maximum = 200 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
};
FixedText 7
{
Pos = MAP_APPFONT ( 12 , 82 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Left = TRUE ;
Text [ en-US ] = "~Operators";
};
MetricField 7
{
HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:7";
Border = TRUE ;
Pos = MAP_APPFONT ( 57 , 81 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 5 ;
Maximum = 200 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
};
FixedText 8
{
Pos = MAP_APPFONT ( 12 , 97 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
Left = TRUE ;
Text [ en-US ] = "~Limits";
};
MetricField 8
{
HelpID = "starmath:MetricField:RID_FONTSIZEDIALOG:8";
Border = TRUE ;
Pos = MAP_APPFONT ( 57 , 96 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Minimum = 5 ;
Maximum = 200 ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
};
FixedLine 1
{
Pos = MAP_APPFONT ( 6 , 24 ) ;
Size = MAP_APPFONT ( 99 , 8 ) ;
Text [ en-US ] = "Relative sizes" ;
};
OKButton 1
{
Pos = MAP_APPFONT ( 114 , 3 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton 1
{
Pos = MAP_APPFONT ( 114 , 21 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton 1
{
Pos = MAP_APPFONT ( 114 , 46 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
HelpID = "starmath:PushButton:RID_FONTSIZEDIALOG:1";
Text [ en-US ] = "~Help" ;
};
PushButton 1
{
HelpID = "starmath:PushButton:RID_FONTSIZEDIALOG:1";
TabStop = TRUE ;
Pos = MAP_APPFONT ( 114 , 64 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Default" ;
};
};
ModalDialog RID_FONTTYPEDIALOG
{
OutputSize = TRUE ;
......
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