No subject
Sat Mar 31 04:12:34 PDT 2012
From: Karan <karan at karan-VirtualBox.(none)>
Date: Sat, 31 Mar 2012 11:57:15 +0530
Subject: [PATCH 1/2] Added Help Button to
SmFontDialog
SmFontSizeDialog
SmFontTypeDialog
SmDistanceDialog
SmAlignDialog
SmSymbolDialog
SmSymDefineDialog
---
starmath/inc/dialog.hxx | 14 +++++++
starmath/source/dialog.cxx | 88
+++++++++++++++++++++++++++++++++++++++++++-
starmath/source/smres.src | 62 +++++++++++++++++++++++++++++-
3 files changed, 160 insertions(+), 4 deletions(-)
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index de3a02f..23f1297 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -105,6 +105,7 @@ class SmFontDialog : public ModalDialog
CheckBox aBoldCheckBox;
CheckBox aItalicCheckBox;
OKButton aOKButton1;
+ HelpButton aHelpButton1;
CancelButton aCancelButton1;
SmShowFont aShowFont;
FixedText aFixedText2;
@@ -114,6 +115,7 @@ class SmFontDialog : public ModalDialog
DECL_LINK(FontSelectHdl, ComboBox *);
DECL_LINK(FontModifyHdl, ComboBox *);
DECL_LINK(AttrChangeHdl, CheckBox *);
+ DECL_LINK(HelpButtonClickHdl, Button *);
void InitColor_Impl();
@@ -144,10 +146,12 @@ class SmFontSizeDialog : public ModalDialog
MetricField aBorderSize;
FixedLine aFixedLine1;
OKButton aOKButton1;
+ HelpButton aHelpButton1;
CancelButton aCancelButton1;
PushButton aDefaultButton;
DECL_LINK(DefaultButtonClickHdl, Button *);
+ DECL_LINK(HelpButtonClickHdl, Button *);
public:
SmFontSizeDialog(Window *pParent, bool bFreeRes = true);
@@ -177,6 +181,7 @@ class SmFontTypeDialog : public ModalDialog
FixedLine aFixedLine1;
FixedLine aFixedLine2;
OKButton aOKButton1;
+ HelpButton aHelpButton1;
CancelButton aCancelButton1;
MenuButton aMenuButton;
PushButton aDefaultButton;
@@ -185,6 +190,7 @@ class SmFontTypeDialog : public ModalDialog
DECL_LINK(MenuSelectHdl, Menu *);
DECL_LINK(DefaultButtonClickHdl, Button *);
+ DECL_LINK(HelpButtonClickHdl, Button *);
public:
SmFontTypeDialog(Window *pParent, OutputDevice *pFntListDevice, bool
bFreeRes = true);
@@ -236,6 +242,7 @@ class SmDistanceDialog : public ModalDialog
FixedText aFixedText4;
MetricField aMetricField4;
OKButton aOKButton1;
+ HelpButton aHelpButton1;
CancelButton aCancelButton1;
MenuButton aMenuButton;
PushButton aDefaultButton;
@@ -249,6 +256,7 @@ class SmDistanceDialog : public ModalDialog
DECL_LINK(GetFocusHdl, Control *);
DECL_LINK(MenuSelectHdl, Menu *);
DECL_LINK(DefaultButtonClickHdl, Button *);
+ DECL_LINK(HelpButtonClickHdl, Button *);
DECL_LINK(CheckBoxClickHdl, CheckBox *);
using Window::SetHelpId;
@@ -277,10 +285,12 @@ class SmAlignDialog : public ModalDialog
RadioButton aRight;
FixedLine aFixedLine1;
OKButton aOKButton1;
+ HelpButton aHelpButton1;
CancelButton aCancelButton1;
PushButton aDefaultButton;
DECL_LINK(DefaultButtonClickHdl, Button *);
+ DECL_LINK(HelpButtonClickHdl, Button *);
public:
SmAlignDialog(Window *pParent, bool bFreeRes = true);
@@ -348,6 +358,7 @@ class SmSymbolDialog : public ModalDialog
SmShowSymbolSet aSymbolSetDisplay;
FixedText aSymbolName;
SmShowSymbol aSymbolDisplay;
+ HelpButton aHelpBtn;
PushButton aGetBtn;
PushButton aCloseBtn;
PushButton aEditBtn;
@@ -366,6 +377,7 @@ class SmSymbolDialog : public ModalDialog
DECL_LINK(CloseClickHdl, Button *);
DECL_LINK(EditClickHdl, Button *);
DECL_LINK(GetClickHdl, Button *);
+ DECL_LINK(HelpButtonClickHdl, Button *);
void FillSymbolSets(bool bDeleteText = true);
void SetSymbolSetManager(SmSymbolManager &rMgr);
@@ -426,6 +438,7 @@ class SmSymDefineDialog : public ModalDialog
SmShowChar aSymbolDisplay;
FixedText aSymbolSetName;
OKButton aOkBtn;
+ HelpButton aHelpBtn;
CancelButton aCancelBtn;
PushButton aAddBtn;
PushButton aChangeBtn;
@@ -450,6 +463,7 @@ class SmSymDefineDialog : public ModalDialog
DECL_LINK(AddClickHdl, Button *);
DECL_LINK(ChangeClickHdl, Button *);
DECL_LINK(DeleteClickHdl, Button *);
+ DECL_LINK(HelpButtonClickHdl, Button *);
void FillSymbols(ComboBox &rComboBox, bool bDeleteText = true);
void FillSymbolSets(ComboBox &rComboBox, bool bDeleteText = true);
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 4895514..8c9f72e 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -327,6 +327,16 @@ void SmFontDialog::SetFont(const Font &rFont)
aShowFont.SetFont(Face);
}
+IMPL_LINK( SmFontDialog, HelpButtonClickHdl, Button *, EMPTYARG
/*pButton*/ )
+{
+ // start help system
+ Help* pHelp = Application::GetHelp();
+ if( pHelp )
+ {
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"HID_SMA_FONTDIALOG" ) ), &aHelpButton );
+ }
+ return 0;
+}
SmFontDialog::SmFontDialog(Window * pParent,
OutputDevice *pFntListDevice, bool bHideCheckboxes, bool bFreeRes)
@@ -336,12 +346,14 @@ SmFontDialog::SmFontDialog(Window * pParent,
aBoldCheckBox (this, SmResId(1)),
aItalicCheckBox (this, SmResId(2)),
aOKButton1 (this, SmResId(1)),
+ aHelpButton1 (this, SmResId(1))
aCancelButton1 (this, SmResId(1)),
aShowFont (this, SmResId(1)),
aFixedText2 (this, SmResId(2))
{
if (bFreeRes)
FreeResource();
+ aHelpButton1.SetClickHdl(LINK(this, SmFontSDialog,
HelpButtonClickHdl));
{
WaitObject( this );
@@ -410,7 +422,6 @@ void SmFontDialog::InitColor_Impl()
aShowFont.SetTextColor( aTxtColor );
}
-
void SmFontDialog::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( rDCEvt.GetType() == DATACHANGED_SETTINGS &&
@@ -439,6 +450,16 @@ IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl,
Button *, EMPTYARG /*pButton
return 0;
}
+IMPL_LINK( SmFontSizeDialog, HelpButtonClickHdl, Button *, EMPTYARG
/*pButton*/ )
+{
+ // start help system
+ Help* pHelp = Application::GetHelp();
+ if( pHelp )
+ {
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"HID_SMA_FONTSIZEDIALOG" ) ), &aHelpButton );
+ }
+ return 0;
+}
SmFontSizeDialog::SmFontSizeDialog(Window * pParent, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_FONTSIZEDIALOG)),
@@ -455,6 +476,7 @@ SmFontSizeDialog::SmFontSizeDialog(Window * pParent,
bool bFreeRes)
aFixedText8(this, SmResId(8)),
aBorderSize(this, SmResId(8)),
aFixedLine1(this, SmResId(1)),
+ aHelpButton1(this, SmResId(1)),
aOKButton1(this, SmResId(1)),
aCancelButton1(this, SmResId(1)),
aDefaultButton(this, SmResId(1))
@@ -463,6 +485,7 @@ SmFontSizeDialog::SmFontSizeDialog(Window * pParent,
bool bFreeRes)
FreeResource();
aDefaultButton.SetClickHdl(LINK(this, SmFontSizeDialog,
DefaultButtonClickHdl));
+ aHelpButton1.SetClickHdl(LINK(this, SmFontSizeDialog,
HelpButtonClickHdl));
}
@@ -547,6 +570,16 @@ IMPL_LINK_INLINE_START( SmFontTypeDialog,
DefaultButtonClickHdl, Button *, EMPTY
}
IMPL_LINK_INLINE_END( SmFontTypeDialog, DefaultButtonClickHdl, Button *,
pButton )
+IMPL_LINK( SmFontTypeDialog, HelpButtonClickHdl, Button *, EMPTYARG
/*pButton*/ )
+{
+ // start help system
+ Help* pHelp = Application::GetHelp();
+ if( pHelp )
+ {
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"HID_SMA_FONTTYPEDIALOG" ) ), &aHelpButton );
+ }
+ return 0;
+}
SmFontTypeDialog::SmFontTypeDialog(Window * pParent, OutputDevice
*pFntListDevice, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_FONTTYPEDIALOG)),
@@ -567,6 +600,7 @@ SmFontTypeDialog::SmFontTypeDialog(Window * pParent,
OutputDevice *pFntListDevic
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)),
@@ -576,6 +610,7 @@ SmFontTypeDialog::SmFontTypeDialog(Window * pParent,
OutputDevice *pFntListDevic
FreeResource();
aDefaultButton.SetClickHdl(LINK(this, SmFontTypeDialog,
DefaultButtonClickHdl));
+ aHelpButton1.SetClickHdl(LINK(this, SmFontTypeDialog,
HelpButtonClickHdl));
aMenuButton.GetPopupMenu()->SetSelectHdl(LINK(this, SmFontTypeDialog,
MenuSelectHdl));
}
@@ -748,6 +783,17 @@ IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl,
Button *, EMPTYARG /*pButton
return 0;
}
+IMPL_LINK( SmDistanceDialog, HelpButtonClickHdl, Button *, EMPTYARG
/*pButton*/ )
+{
+ // start help system
+ Help* pHelp = Application::GetHelp();
+ if( pHelp )
+ {
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"HID_SMA_DISTANCEDIALOG" ) ), &aHelpButton );
+ }
+ return 0;
+}
+
IMPL_LINK( SmDistanceDialog, CheckBoxClickHdl, CheckBox *, pCheckBox )
{
@@ -927,6 +973,7 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent,
bool bFreeRes)
aOKButton1 (this, SmResId(1)),
aCancelButton1 (this, SmResId(1)),
aMenuButton (this, SmResId(1)),
+ aHelpButton1 (this, SmResId(1)),
aDefaultButton (this, SmResId(1)),
aBitmap (this, SmResId(1)),
aFixedLine (this, SmResId(1))
@@ -951,6 +998,7 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent,
bool bFreeRes)
aMenuButton.GetPopupMenu()->SetSelectHdl(LINK(this, SmDistanceDialog,
MenuSelectHdl));
aDefaultButton.SetClickHdl(LINK(this, SmDistanceDialog,
DefaultButtonClickHdl));
+ aHelpButton1.SetClickHdl(LINK(this, SmDistanceDialog,
HelpButtonClickHdl));
}
@@ -1058,6 +1106,17 @@ IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl,
Button *, EMPTYARG /*pButton*/
}
+IMPL_LINK( SmAlignDialog, HelpButtonClickHdl, Button *, EMPTYARG
/*pButton*/ )
+{
+ // start help system
+ Help* pHelp = Application::GetHelp();
+ if( pHelp )
+ {
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"HID_SMA_ALIGNDIALOG" ) ), &aHelpButton );
+ }
+ return 0;
+}
+
SmAlignDialog::SmAlignDialog(Window * pParent, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_ALIGNDIALOG)),
aLeft (this, SmResId(1)),
@@ -1065,6 +1124,7 @@ SmAlignDialog::SmAlignDialog(Window * pParent, bool
bFreeRes)
aRight (this, SmResId(3)),
aFixedLine1 (this, SmResId(1)),
aOKButton1 (this, SmResId(1)),
+ aHelpButton1 (this, SmResId(1)),
aCancelButton1 (this, SmResId(1)),
aDefaultButton (this, SmResId(1))
{
@@ -1072,6 +1132,7 @@ SmAlignDialog::SmAlignDialog(Window * pParent, bool
bFreeRes)
FreeResource();
aDefaultButton.SetClickHdl(LINK(this, SmAlignDialog,
DefaultButtonClickHdl));
+ aHelpButton1.SetClickHdl(LINK(this, SmAlignDialog,
HelpButtonClickHdl));
}
@@ -1491,6 +1552,16 @@ IMPL_LINK_INLINE_START( SmSymbolDialog,
CloseClickHdl, Button *, EMPTYARG pButto
}
IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton )
+IMPL_LINK( SmSymbolDialog, HelpButtonClickHdl, Button *, EMPTYARG
/*pButton*/ )
+{
+ // start help system
+ Help* pHelp = Application::GetHelp();
+ if( pHelp )
+ {
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"HID_SMA_SYMBOLDIALOG" ) ), &aHelpButton );
+ }
+ return 0;
+}
SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice
*pFntListDevice,
SmSymbolManager &rMgr, SmViewShell &rViewShell, bool bFreeRes) :
@@ -1501,6 +1572,7 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent,
OutputDevice *pFntListDevice,
aSymbolName (this, SmResId(2)),
aSymbolDisplay (this, SmResId(2)),
aGetBtn (this, SmResId(2)),
+ aHelpBtn (this, SmResId(1)),
aCloseBtn (this, SmResId(3)),
aEditBtn (this, SmResId(1)),
rViewSh (rViewShell),
@@ -1510,6 +1582,7 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent,
OutputDevice *pFntListDevice,
if (bFreeRes)
FreeResource();
+ aHelpBtn.SetClickHdl(LINK(this, SmSymbolDialog, HelpButtonClickHdl));
aSymbolSetName = rtl::OUString();
aSymbolSet.clear();
FillSymbolSets();
@@ -2016,6 +2089,16 @@ void SmSymDefineDialog::UpdateButtons()
aDeleteBtn.Enable(bDelete);
}
+IMPL_LINK( SmSymDefineDialog, HelpButtonClickHdl, Button *, EMPTYARG
/*pButton*/ )
+{
+ // start help system
+ Help* pHelp = Application::GetHelp();
+ if( pHelp )
+ {
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"HID_SMA_SYMDEFINEDIALOG" ) ), &aHelpButton );
+ }
+ return 0;
+}
SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
OutputDevice *pFntListDevice, SmSymbolManager &rMgr, bool
bFreeRes) :
@@ -2042,6 +2125,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
aSymbolDisplay (this, SmResId(2)),
aSymbolSetName (this, SmResId(6)),
aOkBtn (this, SmResId(1)),
+ aHelpBtn (this, SmResId(1)),
aCancelBtn (this, SmResId(1)),
aAddBtn (this, SmResId(1)),
aChangeBtn (this, SmResId(2)),
@@ -2055,6 +2139,8 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
if (bFreeRes)
FreeResource();
+ aHelpBtn.SetClickHdl(LINK(this, SmSymDefineDialog,
HelpButtonClickHdl));
+
pFontList = new FontList( pFntListDevice );
pOrigSymbol = 0;
diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index e565bfa..a434306 100644
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -79,6 +79,14 @@ ModalDialog RID_FONTDIALOG
Size = MAP_APPFONT ( 33 , 10 ) ;
Text [ en-US ] = "~Italic" ;
};
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 126 , 42 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ HelpID = "starmath:HelpButton:RID_FONTDIALOG:1";
+ Text [ en-US ] = "~Help" ;
+ };
OKButton 1
{
Pos = MAP_APPFONT ( 126 , 6 ) ;
@@ -265,11 +273,19 @@ ModalDialog RID_FONTSIZEDIALOG
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 , 45 ) ;
+ Pos = MAP_APPFONT ( 114 , 64 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Default" ;
};
@@ -429,11 +445,19 @@ ModalDialog RID_FONTTYPEDIALOG
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 , 66 ) ;
+ Pos = MAP_APPFONT ( 225 , 84 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Default" ;
};
@@ -550,6 +574,14 @@ ModalDialog RID_DISTANCEDIALOG
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 184 , 87 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ HelpID = "starmath:HelpButton:RID_DISTANCEDIALOG:1";
+ Text [ en-US ] = "~Help" ;
+ };
PushButton 1
{
HelpID = "starmath:PushButton:RID_DISTANCEDIALOG:1";
@@ -895,11 +927,19 @@ ModalDialog RID_ALIGNDIALOG
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 83 , 46 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ HelpID = "starmath:HelpButton:RID_ALIGNDIALOG:1";
+ Text [ en-US ] = "~Help" ;
+ };
PushButton 1
{
HelpID = "starmath:PushButton:RID_ALIGNDIALOG:1";
TabStop = TRUE ;
- Pos = MAP_APPFONT ( 83 , 46 ) ;
+ Pos = MAP_APPFONT ( 83 , 69 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Default" ;
};
@@ -1083,6 +1123,14 @@ ModalDialog RID_SYMBOLDIALOG
Size = MAP_APPFONT ( 56 , 14 ) ;
Text [ en-US ] = "~Edit..." ;
};
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 117 , 60 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ HelpID = "starmath:HelpButton:RID_SYMBOLDIALOG:1";
+ Text [ en-US ] = "~Help" ;
+ };
};
ModalDialog RID_SYMDEFINEDIALOG
@@ -1293,6 +1341,14 @@ ModalDialog RID_SYMDEFINEDIALOG
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete" ;
};
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 310 , 42 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ HelpID = "starmath:HelpButton:RID_SYMDEFINEDIALOG:1";
+ Text [ en-US ] = "~Help" ;
+ };
OKButton 1
{
Pos = MAP_APPFONT ( 310 , 6 ) ;
--
1.7.5.4
More information about the LibreOffice
mailing list