#96903# make help buttons work

This commit is contained in:
Philipp Lohmann 2002-03-01 07:30:02 +00:00
parent 2e045f25de
commit 70d1304bce
2 changed files with 27 additions and 7 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: adddlg.cxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: pl $ $Date: 2001-12-19 15:36:55 $
* last change: $Author: pl $ $Date: 2002-03-01 08:30:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -398,7 +398,12 @@ APCommandPage::APCommandPage( Window* pParent, DeviceKind::type eKind )
FreeResource();
::std::list< String > aCommands;
if( m_eKind == DeviceKind::Printer )
{
m_aHelpBtn.Show( FALSE );
Size aSize = m_aCommandTxt.GetSizePixel();
aSize.Width() = m_aCommandBox.GetSizePixel().Width();
m_aCommandTxt.SetSizePixel( aSize );
}
if( m_eKind != DeviceKind::Pdf )
{
m_aPdfDirBtn.Show( FALSE );
@ -411,6 +416,21 @@ APCommandPage::APCommandPage( Window* pParent, DeviceKind::type eKind )
case DeviceKind::Fax: CommandStore::getFaxCommands( aCommands );break;
case DeviceKind::Pdf: CommandStore::getPdfCommands( aCommands );break;
}
// adjust height of command text and help button
Rectangle aPosSize( m_aCommandTxt.GetPosPixel(), m_aCommandTxt.GetSizePixel() );
Rectangle aTextSize = m_aCommandTxt.GetTextRect( Rectangle( Point(), aPosSize.GetSize() ), m_aCommandTxt.GetText() );
if( aTextSize.GetWidth() <= 2*(aPosSize.GetWidth()+1) )
{
Size aNewSize( aPosSize.GetWidth(), aPosSize.GetHeight()*2/3 );
if( aNewSize.Height() < m_aHelpBtn.GetSizePixel().Height()+2 )
aNewSize.Height() = m_aHelpBtn.GetSizePixel().Height()+2;
Point aNewPos( aPosSize.Left(), aPosSize.Top() + aPosSize.GetHeight() - aNewSize.Height() );
m_aCommandTxt.SetPosSizePixel( aNewPos, aNewSize );
aNewPos.X() = m_aHelpBtn.GetPosPixel().X();
m_aHelpBtn.SetPosPixel( aNewPos );
}
// fill in commands
::std::list< String >::iterator it;
for( it = aCommands.begin(); it != aCommands.end(); ++it )
m_aCommandBox.InsertEntry( *it );

View file

@ -2,9 +2,9 @@
*
* $RCSfile: padialog.src,v $
*
* $Revision: 1.32 $
* $Revision: 1.33 $
*
* last change: $Author: pl $ $Date: 2002-02-28 17:23:00 $
* last change: $Author: pl $ $Date: 2002-03-01 08:30:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -3058,8 +3058,8 @@ TabPage RID_ADDP_PAGE_COMMAND
};
FixedText RID_ADDP_CMD_TXT_COMMAND
{
Pos = MAP_APPFONT( 10, 10 );
Size = MAP_APPFONT( 220, 16 );
Pos = MAP_APPFONT( 10, 2 );
Size = MAP_APPFONT( 160, 24 );
WordBreak = TRUE;
Text = "Geben Sie bitte eine ~Kommandozeile ein, mit der dieses Gerät angesprochen werden kann";
Text [english] = "Please enter a command ~line appropriate for this device";
@ -3137,7 +3137,7 @@ TabPage RID_ADDP_PAGE_COMMAND
};
PushButton RID_ADDP_CMD_BTN_HELP
{
Pos = MAP_APPFONT( 180, 10 );
Pos = MAP_APPFONT( 180, 2 );
Size = MAP_APPFONT( 50, 12 );
Text = "~Hilfe";
Text [english] = "~Help";