cws tl82: #i86328# 'Elements' ToolBox fixes

This commit is contained in:
Thomas Lange [tl] 2010-08-27 08:59:10 +02:00
parent bb1aadbaf0
commit 130109b6ac
6 changed files with 1869 additions and 1812 deletions

6
starmath/inc/toolbox.hxx Normal file → Executable file
View file

@ -30,12 +30,10 @@
#include <sfx2/basedlgs.hxx>
#include <sfx2/childwin.hxx>
#include <vcl/toolbox.hxx>
#include "smmod.hxx"
#include "config.hxx"
#include "dialog.hrc"
#define NUM_TBX_CATEGORIES 9
#include "toolbox.hrc"
class SmToolBoxWindow : public SfxFloatingWindow
{

1
starmath/source/makefile.mk Normal file → Executable file
View file

@ -45,6 +45,7 @@ SMDLL=TRUE
SRS2NAME =smres
SRC2FILES = smres.src \
symbol.src \
toolbox.src \
commands.src
SLO1FILES = \

File diff suppressed because it is too large Load diff

View file

@ -135,7 +135,7 @@ SmToolBoxWindow::SmToolBoxWindow(SfxBindings *pTmpBindings,
SfxChildWindow *pChildWindow,
Window *pParent) :
SfxFloatingWindow(pTmpBindings, pChildWindow, pParent, SmResId(RID_TOOLBOXWINDOW)),
aToolBoxCat(this, SmResId(NUM_TBX_CATEGORIES + 1)),
aToolBoxCat(this, SmResId(TOOLBOX_CATALOG)),
aToolBoxCat_Delim(this, SmResId( FL_TOOLBOX_CAT_DELIM ))
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmToolBoxWindow::SmToolBoxWindow" );
@ -148,9 +148,9 @@ SmToolBoxWindow::SmToolBoxWindow(SfxBindings *pTmpBindings,
aToolBoxCat.SetClickHdl(LINK(this, SmToolBoxWindow, CategoryClickHdl));
USHORT i;
for (i = 0; i < NUM_TBX_CATEGORIES; i++)
for (i = 0; i < NUM_TBX_CATEGORIES; ++i)
{
ToolBox *pBox = new ToolBox(this, SmResId (i+1));
ToolBox *pBox = new ToolBox(this, SmResId( TOOLBOX_CAT_A + i ));
vToolBoxCategories[i] = pBox;
pBox->SetSelectHdl(LINK(this, SmToolBoxWindow, CmdSelectHdl));
}
@ -168,7 +168,7 @@ SmToolBoxWindow::SmToolBoxWindow(SfxBindings *pTmpBindings,
SmToolBoxWindow::~SmToolBoxWindow()
{
int i;
for (i = 0; i < NUM_TBX_CATEGORIES; i++)
for (i = 0; i < NUM_TBX_CATEGORIES; ++i)
{
ToolBox *pBox = vToolBoxCategories[i];
delete pBox;
@ -246,11 +246,11 @@ void SmToolBoxWindow::StateChanged( StateChangedType nStateChange )
static BOOL bSetPosition = TRUE;
if (STATE_CHANGE_INITSHOW == nStateChange)
{
SetCategory( nActiveCategoryRID == USHRT_MAX ? RID_UNBINOPS_CAT : nActiveCategoryRID );
// calculate initial position to be used after creation of the window...
AdjustPosSize( bSetPosition );
bSetPosition = FALSE;
SetCategory( nActiveCategoryRID == USHRT_MAX ? RID_UNBINOPS_CAT : nActiveCategoryRID );
}
//... otherwise the base class will remember the last position of the window
SfxFloatingWindow::StateChanged( nStateChange );
@ -260,7 +260,7 @@ void SmToolBoxWindow::StateChanged( StateChangedType nStateChange )
void SmToolBoxWindow::AdjustPosSize( BOOL bSetPos )
{
Size aCatSize( aToolBoxCat.CalcWindowSizePixel( 2 ) );
Size aCmdSize( pToolBoxCmd->CalcWindowSizePixel( 5 ) );
Size aCmdSize( pToolBoxCmd->CalcWindowSizePixel( 4 /* see nLines in SetCategory*/ ) );
DBG_ASSERT( aCatSize.Width() == aCmdSize.Width(), "width mismatch" );
// catalog settings
@ -268,14 +268,12 @@ void SmToolBoxWindow::AdjustPosSize( BOOL bSetPos )
aToolBoxCat.SetSizePixel( aCatSize );
// settings for catalog / category delimiter
Point aP( aToolBoxCat_Delim.GetPosPixel() );
aP.X() += 5;
aToolBoxCat_Delim.SetPosPixel( aP );
Size aS( aCatSize.Width() - 10, 10 );
aToolBoxCat_Delim.SetSizePixel( aS );
// category settings
aP.X() = 0;
aToolBoxCat_Delim.SetPosPixel( aP );
aToolBoxCat_Delim.SetSizePixel( Size( aCatSize.Width(), aToolBoxCat_Delim.GetSizePixel().Height() ) );
// category settings
aP.Y() += aToolBoxCat_Delim.GetSizePixel().Height();
for (int i = 0; i < NUM_TBX_CATEGORIES; i++)
for (int i = 0; i < NUM_TBX_CATEGORIES; ++i)
{
vToolBoxCategories[i]->SetPosPixel( aP );
vToolBoxCategories[i]->SetSizePixel( aCmdSize );
@ -331,13 +329,13 @@ void SmToolBoxWindow::SetCategory(USHORT nCategoryRID)
switch (nCategoryRID)
{
case RID_UNBINOPS_CAT : nLines = 4; break;
case RID_RELATIONS_CAT: nLines = 5; break;
case RID_SETOPERATIONS_CAT: nLines = 5; break;
case RID_FUNCTIONS_CAT: nLines = 5; break;
case RID_RELATIONS_CAT: nLines = 4; break;
case RID_SETOPERATIONS_CAT: nLines = 4; break;
case RID_FUNCTIONS_CAT: nLines = 4; break;
case RID_OPERATORS_CAT: nLines = 3; break;
case RID_ATTRIBUTES_CAT: nLines = 5; break;
case RID_ATTRIBUTES_CAT: nLines = 4; break;
case RID_MISC_CAT: nLines = 4; break;
case RID_BRACKETS_CAT: nLines = 5; break;
case RID_BRACKETS_CAT: nLines = 4; break;
case RID_FORMAT_CAT: nLines = 3; break;
default:
// nothing to be done

14
starmath/source/toolbox.hrc Normal file → Executable file
View file

@ -28,7 +28,19 @@
#ifndef _TOOLBOX_HRC_
#define _TOOLBOX_HRC_
#define FL_TOOLBOX_CAT_DELIM 21
#define FL_TOOLBOX_CAT_DELIM 1
#define TOOLBOX_CATALOG 10
#define TOOLBOX_CAT_A 11
#define TOOLBOX_CAT_B 12
#define TOOLBOX_CAT_C 13
#define TOOLBOX_CAT_D 14
#define TOOLBOX_CAT_E 15
#define TOOLBOX_CAT_F 16
#define TOOLBOX_CAT_G 17
#define TOOLBOX_CAT_H 18
#define TOOLBOX_CAT_I 19
#define NUM_TBX_CATEGORIES (TOOLBOX_CAT_I - TOOLBOX_CAT_A + 1)
#endif

1837
starmath/source/toolbox.src Executable file

File diff suppressed because it is too large Load diff