projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix HTML help on Mac.
[wxWidgets.git]
/
src
/
motif
/
toolbar.cpp
diff --git
a/src/motif/toolbar.cpp
b/src/motif/toolbar.cpp
index 70227436b570beae15f18b2d954c13c536b608ef..b38f1c392981d3fa859a3da2cc5b1a2519ec16e7 100644
(file)
--- a/
src/motif/toolbar.cpp
+++ b/
src/motif/toolbar.cpp
@@
-21,6
+21,10
@@
#pragma implementation "toolbar.h"
#endif
#pragma implementation "toolbar.h"
#endif
+#ifdef __VMS
+#define XtDisplay XTDISPLAY
+#endif
+
#include "wx/wx.h"
#include "wx/app.h"
#include "wx/timer.h"
#include "wx/wx.h"
#include "wx/app.h"
#include "wx/timer.h"
@@
-47,7
+51,7
@@
// ----------------------------------------------------------------------------
#if !USE_SHARED_LIBRARY
// ----------------------------------------------------------------------------
#if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wx
Control
)
+IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wx
ToolBarBase
)
#endif
// ----------------------------------------------------------------------------
#endif
// ----------------------------------------------------------------------------
@@
-172,6
+176,12
@@
void wxToolBar::Init()
m_maxHeight = -1;
m_defaultWidth = 24;
m_defaultHeight = 22;
m_maxHeight = -1;
m_defaultWidth = 24;
m_defaultHeight = 22;
+ m_toolPacking = 2;
+ m_toolSeparation = 8;
+ m_xMargin = 2;
+ m_yMargin = 2;
+ m_maxRows = 100;
+ m_maxCols = 100;
}
bool wxToolBar::Create(wxWindow *parent,
}
bool wxToolBar::Create(wxWindow *parent,
@@
-245,6
+255,7
@@
bool wxToolBar::Realize()
// Separator spacing
const int separatorSize = GetToolSeparation(); // 8;
wxSize margins = GetToolMargins();
// Separator spacing
const int separatorSize = GetToolSeparation(); // 8;
wxSize margins = GetToolMargins();
+ int packing = GetToolPacking();
int marginX = margins.x;
int marginY = margins.y;
int marginX = margins.x;
int marginY = margins.y;
@@
-267,9
+278,15
@@
bool wxToolBar::Realize()
switch ( tool->GetStyle() )
{
case wxTOOL_STYLE_CONTROL:
switch ( tool->GetStyle() )
{
case wxTOOL_STYLE_CONTROL:
- wxFAIL_MSG( _T("not implemented") );
- break;
+ {
+ wxControl* control = tool->GetControl();
+ wxSize sz = control->GetSize();
+ wxPoint pos = control->GetPosition();
+ control->Move(currentX, pos.y);
+ currentX += sz.x + packing;
+ break;
+ }
case wxTOOL_STYLE_SEPARATOR:
currentX += separatorSize;
break;
case wxTOOL_STYLE_SEPARATOR:
currentX += separatorSize;
break;
@@
-282,7
+299,12
@@
bool wxToolBar::Realize()
button = XtVaCreateWidget("toggleButton",
xmToggleButtonWidgetClass, (Widget) m_mainWidget,
XmNx, currentX, XmNy, currentY,
button = XtVaCreateWidget("toggleButton",
xmToggleButtonWidgetClass, (Widget) m_mainWidget,
XmNx, currentX, XmNy, currentY,
- // XmNpushButtonEnabled, True,
+ XmNindicatorOn, False,
+ XmNshadowThickness, 2,
+ XmNborderWidth, 0,
+ XmNspacing, 0,
+ XmNmarginWidth, 0,
+ XmNmarginHeight, 0,
XmNmultiClick, XmMULTICLICK_KEEP,
XmNlabelType, XmPIXMAP,
NULL);
XmNmultiClick, XmMULTICLICK_KEEP,
XmNlabelType, XmPIXMAP,
NULL);
@@
-325,9
+347,9
@@
bool wxToolBar::Realize()
wxColour col;
col.SetPixel(backgroundPixel);
wxColour col;
col.SetPixel(backgroundPixel);
-
wxBitmap newBitma
p = wxCreateMaskedBitmap(bmp, col);
+
bm
p = wxCreateMaskedBitmap(bmp, col);
- tool->SetBitmap1(
newBitma
p);
+ tool->SetBitmap1(
bm
p);
}
// Create a selected/toggled bitmap. If there isn't a 2nd
}
// Create a selected/toggled bitmap. If there isn't a 2nd
@@
-388,12
+410,6
@@
bool wxToolBar::Realize()
tool->SetPixmap(pixmap2);
XtVaSetValues (button,
tool->SetPixmap(pixmap2);
XtVaSetValues (button,
- XmNindicatorOn, False,
- XmNshadowThickness, 2,
- // XmNborderWidth, 0,
- // XmNspacing, 0,
- XmNmarginWidth, 0,
- XmNmarginHeight, 0,
XmNfillOnSelect, True,
XmNlabelPixmap, pixmap,
XmNselectPixmap, pixmap2,
XmNfillOnSelect, True,
XmNlabelPixmap, pixmap,
XmNselectPixmap, pixmap2,
@@
-436,7
+452,7
@@
bool wxToolBar::Realize()
XmNwidth, &width,
XmNheight, & height,
NULL);
XmNwidth, &width,
XmNheight, & height,
NULL);
- currentX += width +
marginX
;
+ currentX += width +
packing
;
buttonHeight = wxMax(buttonHeight, height);
}
buttonHeight = wxMax(buttonHeight, height);
}