summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorKaran Desai <kud360@gmail.com>2012-04-01 10:17:21 +0530
committerOlivier Hallot <olivier.hallot@alta.org.br>2012-04-02 08:28:40 -0300
commite2786b3878c391d8b7f4b53b40f30453dbbffbd9 (patch)
treee9ea0654e2cdf24fbcd415425ec1bb10c72ca0a3 /starmath/source
parentc4c6b52a214b474353013f9b1b03d56a5d9a0380 (diff)
Added Help Buttons to dialog buttons in starmath
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/dialog.cxx89
-rw-r--r--starmath/source/smres.src64
2 files changed, 148 insertions, 5 deletions
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 4895514b7f5f..6679ae717ddc 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -39,6 +39,7 @@
#include <svtools/ctrltool.hxx>
#include <sfx2/printer.hxx>
#include <vcl/sound.hxx>
+#include <vcl/help.hxx>
#include <vcl/sndstyle.hxx>
#include <vcl/waitobj.hxx>
#include <vcl/settings.hxx>
@@ -327,6 +328,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" ) ), &aHelpButton1 );
+ }
+ return 0;
+}
SmFontDialog::SmFontDialog(Window * pParent,
OutputDevice *pFntListDevice, bool bHideCheckboxes, bool bFreeRes)
@@ -336,12 +347,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, SmFontDialog, HelpButtonClickHdl));
{
WaitObject( this );
@@ -410,7 +423,6 @@ void SmFontDialog::InitColor_Impl()
aShowFont.SetTextColor( aTxtColor );
}
-
void SmFontDialog::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( rDCEvt.GetType() == DATACHANGED_SETTINGS &&
@@ -439,6 +451,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" ) ), &aHelpButton1 );
+ }
+ return 0;
+}
SmFontSizeDialog::SmFontSizeDialog(Window * pParent, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_FONTSIZEDIALOG)),
@@ -456,6 +478,7 @@ SmFontSizeDialog::SmFontSizeDialog(Window * pParent, bool bFreeRes)
aBorderSize(this, SmResId(8)),
aFixedLine1(this, SmResId(1)),
aOKButton1(this, SmResId(1)),
+ aHelpButton1(this, SmResId(1)),
aCancelButton1(this, SmResId(1)),
aDefaultButton(this, SmResId(1))
{
@@ -463,6 +486,7 @@ SmFontSizeDialog::SmFontSizeDialog(Window * pParent, bool bFreeRes)
FreeResource();
aDefaultButton.SetClickHdl(LINK(this, SmFontSizeDialog, DefaultButtonClickHdl));
+ aHelpButton1.SetClickHdl(LINK(this, SmFontSizeDialog, HelpButtonClickHdl));
}
@@ -547,6 +571,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" ) ), &aHelpButton1 );
+ }
+ return 0;
+}
SmFontTypeDialog::SmFontTypeDialog(Window * pParent, OutputDevice *pFntListDevice, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_FONTTYPEDIALOG)),
@@ -567,6 +601,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 +611,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 +784,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" ) ), &aHelpButton1 );
+ }
+ return 0;
+}
+
IMPL_LINK( SmDistanceDialog, CheckBoxClickHdl, CheckBox *, pCheckBox )
{
@@ -925,6 +972,7 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, bool bFreeRes)
aFixedText4 (this, SmResId(4)),
aMetricField4 (this, SmResId(4)),
aOKButton1 (this, SmResId(1)),
+ aHelpButton1 (this, SmResId(1)),
aCancelButton1 (this, SmResId(1)),
aMenuButton (this, SmResId(1)),
aDefaultButton (this, SmResId(1)),
@@ -951,6 +999,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 +1107,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" ) ), &aHelpButton1 );
+ }
+ return 0;
+}
+
SmAlignDialog::SmAlignDialog(Window * pParent, bool bFreeRes)
: ModalDialog(pParent, SmResId(RID_ALIGNDIALOG)),
aLeft (this, SmResId(1)),
@@ -1065,6 +1125,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 +1133,7 @@ SmAlignDialog::SmAlignDialog(Window * pParent, bool bFreeRes)
FreeResource();
aDefaultButton.SetClickHdl(LINK(this, SmAlignDialog, DefaultButtonClickHdl));
+ aHelpButton1.SetClickHdl(LINK(this, SmAlignDialog, HelpButtonClickHdl));
}
@@ -1491,6 +1553,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" ) ), &aHelpBtn );
+ }
+ return 0;
+}
SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice,
SmSymbolManager &rMgr, SmViewShell &rViewShell, bool bFreeRes) :
@@ -1500,6 +1572,7 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice,
aSymbolSetDisplay (this, SmResId(1)),
aSymbolName (this, SmResId(2)),
aSymbolDisplay (this, SmResId(2)),
+ aHelpBtn (this, SmResId(1)),
aGetBtn (this, SmResId(2)),
aCloseBtn (this, SmResId(3)),
aEditBtn (this, SmResId(1)),
@@ -1510,6 +1583,7 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice,
if (bFreeRes)
FreeResource();
+ aHelpBtn.SetClickHdl(LINK(this, SmSymbolDialog, HelpButtonClickHdl));
aSymbolSetName = rtl::OUString();
aSymbolSet.clear();
FillSymbolSets();
@@ -2016,6 +2090,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" ) ), &aHelpBtn );
+ }
+ return 0;
+}
SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
OutputDevice *pFntListDevice, SmSymbolManager &rMgr, bool bFreeRes) :
@@ -2042,6 +2126,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 +2140,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 e565bfae42c5..5683b932da5c 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" ;
};
@@ -445,7 +469,7 @@ ModalDialog RID_DISTANCEDIALOG
OutputSize = TRUE ;
SVLook = TRUE ;
HelpId = CMD_SID_DISTANCE ;
- Size = MAP_APPFONT ( 240 , 90 ) ;
+ Size = MAP_APPFONT ( 250 , 120 ) ;
Text [ en-US ] = "Spacing" ;
FixedText 1
{
@@ -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 ( 177 , 60 ) ;
+ Size = MAP_APPFONT ( 56 , 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 ) ;