docs/html/faq/*.gif
docs/html/techref/*.htm
docs/html/techref/*.gif
-docs/html/prologio/*.htm
-docs/html/prologio/*.gif
+
docs/html/dialoged/*.htm
docs/html/dialoged/*.gif
-docs/html/wxbuild/*.htm
-docs/html/wxbuild/*.gif
-docs/html/wxtab/*.htm
-docs/html/wxtab/*.gif
-docs/html/wxchart/*.htm
-docs/html/wxchart/*.gif
+
docs/html/wxtree/*.htm
docs/html/wxtree/*.gif
+
docs/html/wxgraph/*.htm
docs/html/wxgraph/*.gif
-docs/html/wxgrid/*.htm
-docs/html/wxgrid/*.gif
+
docs/html/wxhelp/*.htm
docs/html/wxhelp/*.gif
-docs/html/wxhelp2/*.htm
-docs/html/wxhelp2/*.gif
+
docs/html/wxprop/*.htm
docs/html/wxprop/*.gif
+
docs/html/winstall/*.htm
docs/html/winstall/*.gif
+
docs/html/tex2rtf/*.htm
docs/html/tex2rtf/*.gif
+docs/html/odbc/*.htm
+
\membersection{wxDC::GetBackground}\label{wxdcgetbackground}
-\func{wxBrush *}{GetBackground}{\void}
+\func{wxBrush\&}{GetBackground}{\void}
Gets the brush used for painting the background (see \helpref{wxDC::SetBackground}{wxdcsetbackground}).
\membersection{wxDC::GetBrush}\label{wxdcgetbrush}
-\func{wxBrush *}{GetBrush}{\void}
+\func{wxBrush\&}{GetBrush}{\void}
Gets the current brush (see \helpref{wxDC::SetBrush}{wxdcsetbrush}).
\membersection{wxDC::GetFont}\label{wxdcgetfont}
-\func{wxFont *}{GetFont}{\void}
+\func{wxFont\&}{GetFont}{\void}
Gets the current font (see \helpref{wxDC::SetFont}{wxdcsetfont}).
\membersection{wxDC::GetPen}\label{wxdcgetpen}
-\func{wxPen *}{GetPen}{\void}
+\func{wxPen\&}{GetPen}{\void}
Gets the current pen (see \helpref{wxDC::SetPen}{wxdcsetpen}).
\membersection{wxGrid::GetBatchCount}\label{wxgridgetbatchcount}
-\func{void}{GetBatchCount}{\void}
+\constfunc{int}{GetBatchCount}{\void}
Return the level of batch nesting. This is initially zero, and will be incremented
every time BeginBatch is called, and decremented when EndBatch is called. When the
\membersection{wxGrid::GetCell}\label{wxgridgetcell}
-\func{wxGridCell *}{GetCell}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxGridCell *}{GetCell}{\param{int}{ row}, \param{int}{ col}}
Returns the grid cell object associated with this position.
\membersection{wxGrid::GetCellAlignment}\label{wxgridgetcellalignment}
-\func{int}{GetCellAlignment}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{int}{GetCellAlignment}{\param{int}{ row}, \param{int}{ col}}
-\func{int}{GetCellAlignment}{\void}
+\constfunc{int}{GetCellAlignment}{\void}
Sets the text alignment for the cell at the given position, or the global alignment value.
The return value is wxLEFT, wxRIGHT or wxCENTRE.
\membersection{wxGrid::GetCellBackgroundColour}\label{wxgridgetcellbackgroundcolour}
-\func{wxColour\&}{GetCellBackgroundColour}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxColour\&}{GetCellBackgroundColour}{\param{int}{ row}, \param{int}{ col}}
-\func{wxColour\&}{GetCellBackgroundColour}{\void}
+\constfunc{wxColour\&}{GetCellBackgroundColour}{\void}
Gets the background colour for the cell at the given position, or the global background colour.
\membersection{wxGrid::GetCells}\label{wxgridgetcells}
-\func{wxGridCell ***}{GetCells}{\void}
+\constfunc{wxGridCell ***}{GetCells}{\void}
Returns the array of grid cell object associated with this wxGrid.
\membersection{wxGrid::GetCellTextColour}\label{wxgridgetcelltextcolour}
-\func{wxColour\&}{GetCellTextColour}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxColour\&}{GetCellTextColour}{\param{int}{ row}, \param{int}{ col}}
-\func{wxColour\&}{GetCellTextColour}{\void}
+\constfunc{wxColour\&}{GetCellTextColour}{\void}
Gets the text colour for the cell at the given position, or the global text colour.
\membersection{wxGrid::GetCellTextFont}\label{wxgridgetcelltextfont}
-\func{wxFont *}{GetCellTextFont}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{const wxFont\&}{GetCellTextFont}{\param{int}{ row}, \param{int}{ col}}
-\func{wxFont *}{GetCellTextFont}{\void}
+\constfunc{wxFont\&}{GetCellTextFont}{\void}
Gets the text font for the cell at the given position, or the global text font.
\membersection{wxGrid::GetCellValue}\label{wxgridgetcellvalue}
-\func{wxString\&}{GetCellValue}{\param{int}{ row}, \param{int}{ col}}
+\constfunc{wxString\&}{GetCellValue}{\param{int}{ row}, \param{int}{ col}}
Returns the cell value at the given position.
\membersection{wxGrid::GetCols}\label{wxgridgetcols}
-\func{int}{GetCols}{\void}
+\constfunc{int}{GetCols}{\void}
Returns the number of columns in the grid.
\membersection{wxGrid::GetColumnWidth}\label{wxgridcolumnwidth}
-\func{int}{GetColumnWidth}{\param{int}{ col}}
+\constfunc{int}{GetColumnWidth}{\param{int}{ col}}
Gets the width in pixels for column {\it col}.
\membersection{wxGrid::GetCurrentRect}\label{wxgridgetcurrentrect}
-\func{wxRectangle *}{GetCurrentRect}{\void}
+\constfunc{wxRectangle *}{GetCurrentRect}{\void}
Returns a pointer to the rectangle enclosing the currently selected cell.
Do not delete this pointer.
\membersection{wxGrid::GetCursorColumn}\label{wxgridgetcursorcolumn}
-\func{int}{GetCursorColumn}{\void}
+\constfunc{int}{GetCursorColumn}{\void}
Returns the column position of the currently selected cell.
\membersection{wxGrid::GetCursorRow}\label{wxgridgetcursorrow}
-\func{int}{GetCursorRow}{\void}
+\constfunc{int}{GetCursorRow}{\void}
Returns the row position of the currently selected cell.
\membersection{wxGrid::GetEditable}\label{wxgridgeteditable}
-\func{bool}{GetEditable}{\void}
+\constfunc{bool}{GetEditable}{\void}
Returns TRUE if the grid cells can be edited.
\membersection{wxGrid::GetHorizScrollBar}\label{wxgridgethorizscrollbar}
-\func{wxScrollBar *}{GetHorizScrollBar}{\void}
+\constfunc{wxScrollBar *}{GetHorizScrollBar}{\void}
Returns a pointer to the horizontal scrollbar.
\membersection{wxGrid::GetLabelAlignment}\label{wxgridgetlabelalignment}
-\func{int}{GetLabelAlignment}{\param{int}{ orientation}}
+\constfunc{int}{GetLabelAlignment}{\param{int}{ orientation}}
Gets the row or column label alignment. {\it orientation} should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp
\membersection{wxGrid::GetLabelBackgroundColour}\label{wxgridgetlabelbackgroundcolour}
-\func{wxColour\&}{GetLabelBackgroundColour}{\void}
+\constfunc{wxColour\&}{GetLabelBackgroundColour}{\void}
Gets a row and column label text colour.
\membersection{wxGrid::GetLabelSize}\label{wxgridgetlabelsize}
-\func{int}{GetLabelSize}{\param{int}{ orientation}}
+\constfunc{int}{GetLabelSize}{\param{int}{ orientation}}
Gets the row label height, or column label width, in pixels. {\it orientation} should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.
\membersection{wxGrid::GetLabelTextColour}\label{wxgridgetlabeltextcolour}
-\func{wxColour\&}{GetLabelTextColour}{\void}
+\constfunc{wxColour\&}{GetLabelTextColour}{\void}
Gets a row and column label text colour.
\membersection{wxGrid::GetLabelTextFont}\label{wxgridgetlabeltextfont}
-\func{wxFont *}{GetLabelTextFont}{\void}
+\constfunc{wxFont\&}{GetLabelTextFont}{\void}
Gets the font to be used for the row and column labels.
\membersection{wxGrid::GetLabelValue}\label{wxgridgetlabelvalue}
-\func{wxString\&}{GetLabelValue}{\param{int}{ orientation}, \param{int}{ pos}}
+\constfunc{wxString\&}{GetLabelValue}{\param{int}{ orientation}, \param{int}{ pos}}
Gets a row or column label value. {\it orientation} should
be wxHORIZONTAL to specify column label, wxVERTICAL to specify row label.\rtfsp
\membersection{wxGrid::GetRowHeight}\label{wxgridgetrowheight}
-\func{int}{GetRowHeight}{\param{int}{ row}}
+\constfunc{int}{GetRowHeight}{\param{int}{ row}}
Gets the height in pixels for row {\it row}.
\membersection{wxGrid::GetRows}\label{wxgridgetrows}
-\func{int}{GetRows}{\void}
+\constfunc{int}{GetRows}{\void}
Returns the number of rows in the grid.
\membersection{wxGrid::GetScrollPosX}\label{wxgridgetscrollposx}
-\func{int}{GetScrollPosX}{\void}
+\constfunc{int}{GetScrollPosX}{\void}
Returns the column scroll position.
\membersection{wxGrid::GetScrollPosY}\label{wxgridgetscrollposy}
-\func{int}{GetScrollPosY}{\void}
+\constfunc{int}{GetScrollPosY}{\void}
Returns the row scroll position.
\membersection{wxGrid::GetTextItem}\label{wxgridgettextitem}
-\func{wxText *}{GetTextItem}{\void}
+\constfunc{wxText *}{GetTextItem}{\void}
Returns a pointer to the text item used for entering text into a cell.
\membersection{wxGrid::GetVertScrollBar}\label{wxgridgetvertscrollbar}
-\func{wxScrollBar *}{GetVertScrollBar}{\void}
+\constfunc{wxScrollBar *}{GetVertScrollBar}{\void}
Returns a pointer to the vertical scrollbar.
\membersection{wxGrid::SetCellTextFont}\label{wxgridsetcelltextfont}
-\func{void}{SetCellTextFont}{\param{wxFont *}{font}, \param{int}{ row}, \param{int}{ col}}
+\func{void}{SetCellTextFont}{\param{const wxFont\&}{ font}, \param{int}{ row}, \param{int}{ col}}
-\func{void}{SetCellTextFont}{\param{wxFont *}{font}}
+\func{void}{SetCellTextFont}{\param{const wxFont\&}{ font}}
Sets the text font for the cell at the given position, or for the whole grid.
\membersection{wxGrid::SetDividerPen}\label{wxgridsetdividerpen}
-\func{void}{SetDividerPen}{\param{wxPen *}{pen}}
+\func{void}{SetDividerPen}{\param{const wxPen\&}{ pen}}
Specifies the pen to be used for drawing the divisions between cells. The default
is a light grey. If NULL is specified, the divisions will not be drawn.
\membersection{wxGrid::SetLabelTextFont}\label{wxgridsetlabeltextfont}
-\func{void}{SetLabelTextFont}{\param{wxFont *}{font}}
+\func{void}{SetLabelTextFont}{\param{const wxFont\&}{ font}}
Sets the font to be used for the row and column labels.
\membersection{wxWindow::GetChildren}
-\func{wxList*}{GetChildren}{\void}
+\func{wxList\&}{GetChildren}{\void}
-Returns a pointer to the list of the window's children.
+Returns a reference to the list of the window's children.
\membersection{wxWindow::GetClientSize}\label{wxwindowgetclientsize}
\membersection{wxWindow::GetFont}\label{wxwindowgetfont}
-\constfunc{wxFont*}{GetFont}{\void}
+\constfunc{wxFont\&}{GetFont}{\void}
-Returns a pointer to the font for this window.
+Returns a reference to the font for this window.
\wxheading{See also}
painting a tiled bitmap, then a slight flicker might be seen unless
X can be persuaded not to repaint the window background by default.
-- Finish wxNotebook.
+- wxNotebook bug: why doesn't the notebook sample appear until the
+ user resizes the window again? But it's OK for MDI. Strange.
- wxSpinButton
short defaultWidth = wxGRID_DEFAULT_CELL_WIDTH, short defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT);
void PaintGrid(wxDC& dc);
void ClearGrid(void);
- virtual wxGridCell *GetCell(int row, int col);
- inline wxGridCell ***GetCells(void) { return m_gridCells; }
+ virtual wxGridCell *GetCell(int row, int col) const;
+ inline wxGridCell ***GetCells(void) const { return m_gridCells; }
bool InsertCols(int pos = 0, int n = 1, bool updateLabels = TRUE);
bool InsertRows(int pos = 0, int n = 1, bool updateLabels = TRUE);
bool AppendCols(int n = 1, bool updateLabels = TRUE);
// Cell accessors
void SetCellValue(const wxString& val, int row, int col);
- wxString& GetCellValue(int row, int col);
+ wxString& GetCellValue(int row, int col) const;
void SetCellAlignment(int flag, int row, int col);
void SetCellAlignment(int flag);
- int GetCellAlignment(int row, int col);
- int GetCellAlignment(void);
+ int GetCellAlignment(int row, int col) const;
+ int GetCellAlignment(void) const;
void SetCellTextColour(const wxColour& val, int row, int col);
void SetCellTextColour(const wxColour& col);
- wxColour& GetCellTextColour(int row, int col);
- inline wxColour& GetCellTextColour(void) { return m_cellTextColour; }
+ wxColour& GetCellTextColour(int row, int col) const;
+ inline wxColour& GetCellTextColour(void) const { return (wxColour&) m_cellTextColour; }
void SetCellBackgroundColour(const wxColour& col);
void SetCellBackgroundColour(const wxColour& colour, int row, int col);
- inline wxColour& GetCellBackgroundColour(void) { return m_cellBackgroundColour; }
- wxColour& GetCellBackgroundColour(int row, int col);
- inline wxFont *GetCellTextFont(void) { return m_cellTextFont; }
- wxFont *GetCellTextFont(int row, int col);
- void SetCellTextFont(wxFont *fnt);
- void SetCellTextFont(wxFont *fnt, int row, int col);
- wxBitmap *GetCellBitmap(int row, int col);
+ inline wxColour& GetCellBackgroundColour(void) const { return (wxColour&) m_cellBackgroundColour; }
+ wxColour& GetCellBackgroundColour(int row, int col) const;
+ inline wxFont& GetCellTextFont(void) const { return (wxFont&) m_cellTextFont; }
+ wxFont& GetCellTextFont(int row, int col) const;
+ void SetCellTextFont(const wxFont& fnt);
+ void SetCellTextFont(const wxFont& fnt, int row, int col);
+ wxBitmap *GetCellBitmap(int row, int col) const;
void SetCellBitmap(wxBitmap *bitmap, int row, int col);
// Size accessors
void SetColumnWidth(int col, int width);
- int GetColumnWidth(int col);
+ int GetColumnWidth(int col) const;
void SetRowHeight(int row, int height);
- int GetRowHeight(int row);
+ int GetRowHeight(int row) const;
// Label accessors
void SetLabelSize(int orientation, int sz);
- int GetLabelSize(int orientation);
+ int GetLabelSize(int orientation) const;
void SetLabelAlignment(int orientation, int alignment);
- int GetLabelAlignment(int orientation);
- wxGridCell *GetLabelCell(int orientation, int pos);
+ int GetLabelAlignment(int orientation) const;
+ wxGridCell *GetLabelCell(int orientation, int pos) const;
void SetLabelValue(int orientation, const wxString& val, int pos);
- wxString& GetLabelValue(int orientation, int pos);
+ wxString& GetLabelValue(int orientation, int pos) const;
void SetLabelTextColour(const wxColour& colour);
void SetLabelBackgroundColour(const wxColour& colour);
- inline wxColour& GetLabelTextColour(void) { return m_labelTextColour; }
- inline wxColour& GetLabelBackgroundColour(void) { return m_labelBackgroundColour; }
- inline wxFont *GetLabelTextFont(void) { return m_labelTextFont; }
- inline void SetLabelTextFont(wxFont *fnt) { m_labelTextFont = fnt; }
+ inline wxColour& GetLabelTextColour(void) const { return (wxColour&) m_labelTextColour; }
+ inline wxColour& GetLabelBackgroundColour(void) { return (wxColour&) m_labelBackgroundColour; }
+ inline wxFont& GetLabelTextFont(void) { return (wxFont&) m_labelTextFont; }
+ inline void SetLabelTextFont(const wxFont& fnt) { m_labelTextFont = fnt; }
// Miscellaneous accessors
- inline int GetCursorRow(void) { return m_wCursorRow; }
- inline int GetCursorColumn(void) { return m_wCursorColumn; }
+ inline int GetCursorRow(void) const { return m_wCursorRow; }
+ inline int GetCursorColumn(void) const { return m_wCursorColumn; }
void SetGridCursor(int row, int col);
- inline int GetRows(void) { return m_totalRows; }
- inline int GetCols(void) { return m_totalCols; }
- inline int GetScrollPosX(void) { return m_scrollPosX; }
- inline int GetScrollPosY(void) { return m_scrollPosY; }
+ inline int GetRows(void) const { return m_totalRows; }
+ inline int GetCols(void) const { return m_totalCols; }
+ inline int GetScrollPosX(void) const { return m_scrollPosX; }
+ inline int GetScrollPosY(void) const { return m_scrollPosY; }
inline void SetScrollPosX(int pos) { m_scrollPosX = pos; }
inline void SetScrollPosY(int pos) { m_scrollPosY = pos; }
- inline wxTextCtrl *GetTextItem(void) { return m_textItem; }
- inline wxScrollBar *GetHorizScrollBar(void) { return m_hScrollBar; }
- inline wxScrollBar *GetVertScrollBar(void) { return m_vScrollBar; }
- inline bool GetEditable(void) { return m_editable; }
+ inline wxTextCtrl *GetTextItem(void) const { return m_textItem; }
+ inline wxScrollBar *GetHorizScrollBar(void) const { return m_hScrollBar; }
+ inline wxScrollBar *GetVertScrollBar(void) const { return m_vScrollBar; }
+ inline bool GetEditable(void) const { return m_editable; }
void SetEditable(bool edit);
- inline wxRect& GetCurrentRect(void) { return m_currentRect; }
- inline bool CurrentCellVisible(void) { return m_currentRectVisible; }
- inline void SetDividerPen(wxPen *pen) { m_divisionPen = pen; }
- inline wxPen *GetDividerPen(void) { return m_divisionPen; }
+ inline wxRect& GetCurrentRect(void) const { return (wxRect&) m_currentRect; }
+ inline bool CurrentCellVisible(void) const { return m_currentRectVisible; }
+ inline void SetDividerPen(const wxPen& pen) { m_divisionPen = pen; }
+ inline wxPen& GetDividerPen(void) const { return (wxPen&) m_divisionPen; }
// High-level event handling
// Override e.g. to check value of current cell; but call
wxScrollBar* m_vScrollBar;
int m_wCursorRow;
int m_wCursorColumn;
- wxRect m_currentRect;
+ wxRect m_currentRect;
bool m_currentRectVisible;
wxGridCell*** m_gridCells;
wxGridCell** m_rowLabelCells;
// Colours
wxColour m_cellTextColour;
wxColour m_cellBackgroundColour;
- wxFont* m_cellTextFont;
+ wxFont m_cellTextFont;
wxColour m_labelTextColour;
wxColour m_labelBackgroundColour;
- wxBrush* m_labelBackgroundBrush;
- wxFont* m_labelTextFont;
- wxPen* m_divisionPen;
+ wxBrush m_labelBackgroundBrush;
+ wxFont m_labelTextFont;
+ wxPen m_divisionPen;
wxBitmap* m_doubleBufferingBitmap;
// Position of Edit control
- wxRect m_editControlPosition;
+ wxRect m_editControlPosition;
// Drag status
int m_dragStatus;
int m_dragRowOrCol;
int m_dragStartPosition;
int m_dragLastPosition;
- wxCursor* m_horizontalSashCursor;
- wxCursor* m_verticalSashCursor;
+ wxCursor m_horizontalSashCursor;
+ wxCursor m_verticalSashCursor;
// To avoid multiple refreshes, use Begin/EndBatch
int m_batchCount;
class WXDLLEXPORT wxGridCell: public wxObject
{
public:
- wxString textValue;
- wxFont *font;
- wxColour textColour;
- wxColour backgroundColour;
- wxBrush *backgroundBrush;
- wxBitmap *cellBitmap;
+ wxString textValue;
+ wxFont font;
+ wxColour textColour;
+ wxColour backgroundColour;
+ wxBrush backgroundBrush;
+ wxBitmap* cellBitmap;
int alignment;
wxGridCell(wxGenericGrid *window = (wxGenericGrid *) NULL);
~wxGridCell(void);
- virtual wxString& GetTextValue(void) { return textValue; }
+ virtual wxString& GetTextValue(void) const { return (wxString&) textValue; }
virtual void SetTextValue(const wxString& str) { textValue = str; }
- inline wxFont *GetFont(void) { return font; }
- inline void SetFont(wxFont *f) { font = f; }
- inline wxColour& GetTextColour(void) { return textColour; }
+ inline wxFont& GetFont(void) const { return (wxFont&) font; }
+ inline void SetFont(const wxFont& f) { font = f; }
+ inline wxColour& GetTextColour(void) const { return (wxColour&) textColour; }
inline void SetTextColour(const wxColour& colour) { textColour = colour; }
- inline wxColour& GetBackgroundColour(void) { return backgroundColour; }
+ inline wxColour& GetBackgroundColour(void) const { return (wxColour&) backgroundColour; }
void SetBackgroundColour(const wxColour& colour);
- inline wxBrush *GetBackgroundBrush(void) { return backgroundBrush; }
- inline void SetBackgroundBrush(wxBrush *brush) { backgroundBrush = brush; }
- inline int GetAlignment(void) { return alignment; }
+ inline wxBrush& GetBackgroundBrush(void) const { return (wxBrush&) backgroundBrush; }
+ inline void SetBackgroundBrush(const wxBrush& brush) { backgroundBrush = brush; }
+ inline int GetAlignment(void) const { return alignment; }
inline void SetAlignment(int align) { alignment = align; }
- inline wxBitmap *GetCellBitmap(void) { return cellBitmap; }
+ inline wxBitmap *GetCellBitmap(void) const { return cellBitmap; }
inline void SetCellBitmap(wxBitmap *bitmap) { cellBitmap = bitmap; }
};
}
};
-
-
-
class WXDLLEXPORT wxGridEvent : public wxCommandEvent {
DECLARE_DYNAMIC_CLASS(wxGridEvent)
public:
// Copy constructors
inline wxBitmap(const wxBitmap& bitmap)
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
- inline wxBitmap(const wxBitmap* bitmap) { if (bitmap) Ref(*bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
// Initialize with raw XBM data
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple);
inline wxBrush(const wxBrush& brush) { Ref(brush); }
- inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
~wxBrush();
virtual void SetColour(const wxColour& col) ;
// copy ctors and assignment operators
wxColour( const wxColour& col );
- wxColour( const wxColour* col );
wxColour& operator = ( const wxColour& col );
// dtor
// Copy constructors
inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
- inline wxCursor(const wxCursor* cursor) { if (cursor) Ref(*cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
virtual void Clear(void) = 0;
virtual void SetFont( const wxFont &font ) = 0;
- virtual wxFont *GetFont(void) const { return (wxFont*) &m_font; };
+ virtual wxFont& GetFont(void) const { return (wxFont&) m_font; };
virtual void SetPen( const wxPen &pen ) = 0;
- virtual wxPen *GetPen(void) const { return (wxPen*) &m_pen; };
+ virtual wxPen& GetPen(void) const { return (wxPen&) m_pen; };
virtual void SetBrush( const wxBrush &brush ) = 0;
- virtual wxBrush *GetBrush(void) const { return (wxBrush*) &m_brush; };
+ virtual wxBrush& GetBrush(void) const { return (wxBrush&) m_brush; };
virtual void SetBackground( const wxBrush &brush ) = 0;
- virtual wxBrush *GetBackground(void) const { return (wxBrush*) &m_backgroundBrush; };
+ virtual wxBrush& GetBackground(void) const { return (wxBrush&) m_backgroundBrush; };
virtual void SetLogicalFunction( int function ) = 0;
virtual int GetLogicalFunction(void) const { return m_logicalFunction; };
wxFont();
wxFont(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString);
inline wxFont(const wxFont& font) { Ref(font); }
- inline wxFont(const wxFont* font) { if (font) Ref(*font); }
~wxFont();
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
- inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
// Initialize with XBM data
wxIcon(const char bits[], int width, int height);
// callbacks
// ---------
void OnSize(wxSizeEvent& event);
+ void OnIdle(wxIdleEvent& event);
void OnSelChange(wxNotebookEvent& event);
void OnSetFocus(wxFocusEvent& event);
void OnNavigationKey(wxNavigationKeyEvent& event);
public:
wxPalette();
inline wxPalette(const wxPalette& palette) { Ref(palette); }
- inline wxPalette(const wxPalette* palette) { UnRef(); if (palette) Ref(*palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
wxPen(const wxColour& col, int width, int style);
wxPen(const wxBitmap& stipple, int width);
inline wxPen(const wxPen& pen) { Ref(pen); }
- inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
~wxPen();
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
inline wxWindow *GetParent() const;
inline void SetParent(wxWindow *p) ;
inline wxWindow *GetGrandParent() const;
- inline wxList *GetChildren() const;
+ inline wxList& GetChildren() const;
// Reparents this window to have the new parent.
virtual bool Reparent(wxWindow* parent);
// Set/get the window's font
virtual void SetFont(const wxFont& f);
- inline virtual wxFont *GetFont() const;
+ inline virtual wxFont& GetFont() const;
// Set/get the window's validator
void SetValidator(const wxValidator& validator);
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); }
-inline wxList *wxWindow::GetChildren() const { return m_children; }
-inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; }
+inline wxList& wxWindow::GetChildren() const { return (wxList&) * m_children; }
+inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; }
inline wxString wxWindow::GetName() const { return m_windowName; }
inline void wxWindow::SetName(const wxString& name) { m_windowName = name; }
inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; }
// Copy constructors
inline wxBitmap(const wxBitmap& bitmap)
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
- inline wxBitmap(const wxBitmap* bitmap) { if (bitmap) Ref(*bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
// Initialize with raw data
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple);
inline wxBrush(const wxBrush& brush) { Ref(brush); }
- inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
~wxBrush(void);
virtual void SetColour(const wxColour& col) ;
inline virtual void SetLabelFont(const wxFont& font);
inline virtual void SetButtonFont(const wxFont& font);
- inline wxFont *GetLabelFont(void) const ;
- inline wxFont *GetButtonFont(void) const ;
+ inline wxFont& GetLabelFont(void) const ;
+ inline wxFont& GetButtonFont(void) const ;
#endif
// Places item in centre of panel - so can't be used BEFORE panel->Fit()
inline void wxControl::Callback(const wxFunction function) { m_callback = function; }; // Adds callback
#if WXWIN_COMPATIBILITY
-inline wxFont *wxControl::GetLabelFont(void) const { return GetFont() ; }
-inline wxFont *wxControl::GetButtonFont(void) const { return GetFont() ; }
+inline wxFont& wxControl::GetLabelFont(void) const { return GetFont() ; }
+inline wxFont& wxControl::GetButtonFont(void) const { return GetFont() ; }
inline void wxControl::SetLabelFont(const wxFont& font) { SetFont(font); }
inline void wxControl::SetButtonFont(const wxFont& font) { SetFont(font); }
#endif
// Copy constructors
inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
- inline wxCursor(const wxCursor* cursor) { /* UnRef(); */ if (cursor) Ref(*cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
inline virtual bool Ok(void) const {return m_ok;};
inline virtual int GetMapMode(void) const {return m_mappingMode;};
- inline virtual wxBrush *GetBackground(void) const { return (wxBrush*) &m_backgroundBrush ;}
- inline virtual wxBrush *GetBrush(void) const { return (wxBrush*) &m_brush ;}
- inline virtual wxFont *GetFont(void) const { return (wxFont*) &m_font ;}
+ inline virtual wxBrush& GetBackground(void) const { return (wxBrush&) m_backgroundBrush ;}
+ inline virtual wxBrush& GetBrush(void) const { return (wxBrush&) m_brush ;}
+ inline virtual wxFont& GetFont(void) const { return (wxFont&) m_font ;}
inline virtual int GetLogicalFunction(void) const { return m_logicalFunction ;}
- inline virtual wxPen *GetPen(void) const { return (wxPen*) &m_pen ;}
+ inline virtual wxPen& GetPen(void) const { return (wxPen&) m_pen ;}
inline virtual wxColour&GetTextBackground(void) const { return (wxColour&) m_textBackgroundColour ;}
inline virtual wxColour&GetTextForeground(void) const { return (wxColour&) m_textForegroundColour ;}
wxFont(void);
wxFont(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString);
inline wxFont(const wxFont& font) { Ref(font); }
- inline wxFont(const wxFont* font) { if (font) Ref(*font); }
~wxFont(void);
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
- inline wxIcon(const wxIcon* icon) { /* UnRef(); */ if (icon) Ref(*icon); }
wxIcon(const char bits[], int width, int height);
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
public:
wxPalette(void);
inline wxPalette(const wxPalette& palette) { Ref(palette); }
- inline wxPalette(const wxPalette* palette) { /* UnRef(); */ if (palette) Ref(*palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(void);
wxPen(const wxColour& col, int width, int style);
wxPen(const wxBitmap& stipple, int width);
inline wxPen(const wxPen& pen) { Ref(pen); }
- inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
~wxPen();
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
// Set the cursor
virtual void SetCursor(const wxCursor& cursor);
- inline virtual wxCursor *GetCursor() const { return (wxCursor *)& m_windowCursor; };
+ inline virtual wxCursor& GetCursor() const { return (wxCursor& ) m_windowCursor; };
// Get the window with the focus
static wxWindow *FindFocus();
inline wxWindow *GetParent() const;
inline void SetParent(wxWindow *p) ;
inline wxWindow *GetGrandParent() const;
- inline wxList *GetChildren() const;
+ inline wxList& GetChildren() const;
// Set this window to be the child of 'parent'.
// Returns FALSE it's not possible (some systems
// won't allow it)
// Set/get the window's font
virtual void SetFont(const wxFont& f);
- inline virtual wxFont *GetFont() const;
+ inline virtual wxFont& GetFont() const;
// Set/get the window's validator
void SetValidator(const wxValidator& validator);
// For backward compatibility
inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
inline virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
- inline virtual wxFont *GetLabelFont() const { return GetFont(); };
- inline virtual wxFont *GetButtonFont() const { return GetFont(); };
+ inline virtual wxFont& GetLabelFont() const { return GetFont(); };
+ inline virtual wxFont& GetButtonFont() const { return GetFont(); };
// Get the default button, if there is one
inline virtual wxButton *GetDefaultItem() const;
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); }
-inline wxList *wxWindow::GetChildren() const { return m_children; }
-inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; }
+inline wxList& wxWindow::GetChildren() const { return (wxList&) *m_children; }
+inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; }
inline wxString wxWindow::GetName() const { return m_windowName; }
inline void wxWindow::SetName(const wxString& name) { m_windowName = name; }
inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; }
// Copy constructors
inline wxBitmap(const wxBitmap& bitmap)
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
- inline wxBitmap(const wxBitmap* bitmap) { if (bitmap) Ref(*bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
// Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple);
inline wxBrush(const wxBrush& brush) { Ref(brush); }
- inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
~wxBrush();
virtual void SetColour(const wxColour& col) ;
}
bool operator != (const wxColour& colour) { return !(*this == colour); }
+ void InitFromName(const wxString& col);
+
/* TODO
WXCOLORREF GetPixel() const { return m_pixel; };
*/
// Copy constructors
inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
- inline wxCursor(const wxCursor* cursor) { if (cursor) Ref(*cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
virtual void Clear(void) = 0;
virtual void SetFont( const wxFont &font ) = 0;
- virtual wxFont *GetFont(void) const { return (wxFont*) &m_font; };
+ virtual wxFont& GetFont(void) const { return (wxFont&) m_font; };
virtual void SetPen( const wxPen &pen ) = 0;
- virtual wxPen *GetPen(void) const { return (wxPen*) &m_pen; };
+ virtual wxPen& GetPen(void) const { return (wxPen&) m_pen; };
virtual void SetBrush( const wxBrush &brush ) = 0;
- virtual wxBrush *GetBrush(void) const { return (wxBrush*) &m_brush; };
+ virtual wxBrush& GetBrush(void) const { return (wxBrush&) m_brush; };
virtual void SetBackground( const wxBrush &brush ) = 0;
- virtual wxBrush *GetBackground(void) const { return (wxBrush*) &m_backgroundBrush; };
+ virtual wxBrush& GetBackground(void) const { return (wxBrush&) m_backgroundBrush; };
virtual void SetLogicalFunction( int function ) = 0;
virtual int GetLogicalFunction(void) const { return m_logicalFunction; };
wxFont();
wxFont(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString);
inline wxFont(const wxFont& font) { Ref(font); }
- inline wxFont(const wxFont* font) { if (font) Ref(*font); }
~wxFont();
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
- inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
wxIcon(const char bits[], int width, int height);
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
public:
wxPalette();
inline wxPalette(const wxPalette& palette) { Ref(palette); }
- inline wxPalette(const wxPalette* palette) { UnRef(); if (palette) Ref(*palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
wxPen(const wxColour& col, int width, int style);
wxPen(const wxBitmap& stipple, int width);
inline wxPen(const wxPen& pen) { Ref(pen); }
- inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
~wxPen();
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
#include "wx/list.h"
#include "wx/gdiobj.h"
+#include "wx/gdicmn.h"
class WXDLLEXPORT wxRect;
class WXDLLEXPORT wxPoint;
virtual void Notify() = 0; // Override this member
// Returns the current interval time (0 if stop)
- int Interval() const { return milli; };
- bool OneShot() const { return oneShot; }
+ int Interval() const { return m_milli; };
+ bool OneShot() const { return m_oneShot; }
protected:
- bool oneShot ;
- int milli ;
- int lastMilli ;
+ bool m_oneShot ;
+ int m_milli ;
+ int m_lastMilli ;
- long id;
+ long m_id;
private:
DECLARE_ABSTRACT_CLASS(wxTimer)
WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize;
WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition;
+//-----------------------------------------------------------------------------
+// wxClientData
+//-----------------------------------------------------------------------------
+
+class wxClientData
+{
+public:
+ wxClientData() { }
+ virtual ~wxClientData() { }
+};
+
+//-----------------------------------------------------------------------------
+// wxStringClientData
+//-----------------------------------------------------------------------------
+
+class wxStringClientData: public wxClientData
+{
+public:
+ wxStringClientData() { }
+ wxStringClientData( wxString &data ) { m_data = data; }
+ void SetData( wxString &data ) { m_data = data; }
+ wxString GetData() const { return m_data; }
+
+private:
+ wxString m_data;
+};
+
class WXDLLEXPORT wxWindow: public wxEvtHandler
{
DECLARE_ABSTRACT_CLASS(wxWindow)
inline wxWindow *GetParent() const;
inline void SetParent(wxWindow *p) ;
inline wxWindow *GetGrandParent() const;
- inline wxList *GetChildren() const;
+ inline wxList& GetChildren() const;
// Set/get the window's font
virtual void SetFont(const wxFont& f);
- inline virtual wxFont *GetFont() const;
+ inline virtual wxFont& GetFont() const;
// Set/get the window's validator
void SetValidator(const wxValidator& validator);
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); }
-inline wxList *wxWindow::GetChildren() const { return m_children; }
-inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; }
+inline wxList& wxWindow::GetChildren() const { return (wxList&) * m_children; }
+inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; }
inline wxString wxWindow::GetName() const { return m_windowName; }
inline void wxWindow::SetName(const wxString& name) { m_windowName = name; }
inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; }
frame->grid->SetCellValue("First cell", 0, 0);
frame->grid->SetCellValue("Another cell", 1, 1);
frame->grid->SetCellValue("Yet another cell", 2, 2);
- frame->grid->SetCellTextFont(wxTheFontList->FindOrCreateFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
+ frame->grid->SetCellTextFont(* wxTheFontList->FindOrCreateFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
frame->grid->SetCellTextColour(*wxRED, 1, 1);
frame->grid->SetCellBackgroundColour(*wxCYAN, 2, 2);
if (cellBitmap1 && cellBitmap2)
void MyFrame::ToggleDividers(wxCommandEvent& WXUNUSED(event))
{
- if (!grid->GetDividerPen())
- grid->SetDividerPen(wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID));
+ if (!grid->GetDividerPen().Ok())
+ grid->SetDividerPen(* wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID));
else
- grid->SetDividerPen((wxPen *) NULL);
+ grid->SetDividerPen(wxNullPen);
grid->Refresh();
}
void MyFrame::Draw(wxDC& dc, bool WXUNUSED(draw_bitmaps) )
{
- dc.SetPen(wxGREEN_PEN);
+ dc.SetPen(* wxGREEN_PEN);
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
- dc.SetBrush(wxCYAN_BRUSH);
- dc.SetPen(wxRED_PEN);
+ dc.SetBrush(* wxCYAN_BRUSH);
+ dc.SetPen(* wxRED_PEN);
dc.DrawRectangle(100, 100, 100, 50);
dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
dc.DrawSpline(50, 200, 50, 100, 200, 10);
dc.DrawLine(50, 230, 200, 230);
- dc.SetPen(wxBLACK_PEN);
+ dc.SetPen(* wxBLACK_PEN);
dc.DrawArc(50, 300, 100, 250, 100, 300 );
}
float bottomMarginLogical = (float)(logUnitsFactor*(pageHeightMM - bottomMargin));
float rightMarginLogical = (float)(logUnitsFactor*(pageWidthMM - rightMargin));
- dc->SetPen(wxRED_PEN);
+ dc->SetPen(* wxRED_PEN);
dc->DrawLine( (long)leftMarginLogical, (long)topMarginLogical,
(long)rightMarginLogical, (long)topMarginLogical);
dc->DrawLine( (long)leftMarginLogical, (long)bottomMarginLogical,
// know the dimension is obtainable immediately.
// E.g. a wxExpandSizer may contain a button (but the button's
// true parent is a panel, not the sizer)
- if (other->GetChildren()->Member(thisWin))
+ if (other->GetChildren().Member(thisWin))
{
switch (which)
{
doneSoFar.Append(win);
- wxNode *node = win->GetChildren()->First();
+ wxNode *node = win->GetChildren().First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
while ((noChanges > 0) && (noIterations < maxIterations))
{
noChanges = 0;
- wxNode *node = win->GetChildren()->First();
+ wxNode *node = win->GetChildren().First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
*/
// Now set the sizes and positions of the children, and
// recursively call Layout().
- node = win->GetChildren()->First();
+ node = win->GetChildren().First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
{
// Remove all children without deleting them,
// or ~wxbWindow will delete proper windows _twice_
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxNode *next = node->Next();
void wxSizer::AddSizerChild(wxWindow *child)
{
child->SetSizerParent(this);
- GetChildren()->Append(child);
+ GetChildren().Append(child);
// Add some constraints for the purpose of storing
// the relative position of the window/sizer
void wxSizer::RemoveSizerChild(wxWindow *child)
{
- GetChildren()->DeleteObject(child);
+ GetChildren().DeleteObject(child);
}
void wxSizer::SetSize(int x, int y, int w, int h, int WXUNUSED(flags))
// Find the bounding box and set own size
int maxX = 0;
int maxY = 0;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
int x, y, width, height;
int maxX = currentX;
int maxY = currentY;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
else
{
wxLogWarning(_("Icon resource specification %s not found."), (const char*) resource);
- return (wxIcon *) NULL;
+ return wxNullIcon;
}
}
}
// Should have some kind of font at this point
- if (!GetFont()->Ok())
+ if (!GetFont().Ok())
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
if (!GetBackgroundColour().Ok())
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
{
dc.SetClippingRegion(ax, ay, (bx-ax+1), (by-ay+1));
dc.Blit((ax+1), (ay+1), (bx-ax-2), (by-ay-2), &memDC, 0, 0);
- wxPen * old_pen = dc.GetPen();
+ wxPen * old_pen = & dc.GetPen();
dc.SetPen( white_pen );
dc.DrawLine(ax,(by-1),ax,ay);
dc.DrawLine(ax,ay,(bx-1),ay);
memDC.SelectObject(tool->m_bitmap1);
dc.SetClippingRegion(ax, ay, (bx-ax+1), (by-ay+1));
dc.Blit((ax+2), (ay+2), (bx-ax-2), (by-ay-2), &memDC, 0, 0);
- wxPen * old_pen = dc.GetPen();
+ wxPen * old_pen = & dc.GetPen();
dc.SetPen( black_pen );
dc.DrawLine(ax,(by-1),ax,ay);
dc.DrawLine(ax,ay,(bx-1),ay);
if (parent)
{
- for (wxNode * node = parent->GetChildren()->First (); node; node = node->Next ())
+ for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
{
wxWindow *win = (wxWindow *) node->Data ();
wxWindow *retwin = wxFindWindowByLabel1 (title, win);
if (parent)
{
- for (wxNode * node = parent->GetChildren()->First (); node; node = node->Next ())
+ for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
{
wxWindow *win = (wxWindow *) node->Data ();
wxWindow *retwin = wxFindWindowByName1 (title, win);
m_labelTextColour = *wxBLACK;
// m_labelBackgroundColour = *wxLIGHT_GREY;
m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
- m_labelBackgroundBrush = (wxBrush *) NULL;
- m_labelTextFont = (wxFont *) NULL;
- m_cellTextFont = (wxFont *) NULL;
+ m_labelBackgroundBrush = wxNullBrush;
+ m_labelTextFont = wxNullFont;
+ m_cellTextFont = wxNullFont;
m_textItem = (wxTextCtrl *) NULL;
m_currentRectVisible = FALSE;
m_editable = TRUE;
m_dragRowOrCol = 0;
m_dragStartPosition = 0;
m_dragLastPosition = 0;
- m_divisionPen = (wxPen *) NULL;
+ m_divisionPen = wxNullPen;
m_leftOfSheet = wxGRID_DEFAULT_SHEET_LEFT;
m_topOfSheet = wxGRID_DEFAULT_SHEET_TOP;
m_cellHeight = wxGRID_DEFAULT_CELL_HEIGHT;
m_rowLabelCells = (wxGridCell **) NULL;
m_colLabelCells = (wxGridCell **) NULL;
m_textItem = (wxTextCtrl *) NULL;
- m_horizontalSashCursor = (wxCursor *) NULL;
- m_verticalSashCursor = (wxCursor *) NULL;
}
bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
m_editingPanel = (wxPanel *) NULL;
m_hScrollBar = (wxScrollBar *) NULL;
m_vScrollBar = (wxScrollBar *) NULL;
- m_horizontalSashCursor = (wxCursor *) NULL;
- m_verticalSashCursor = (wxCursor *) NULL;
m_cellTextColour = *wxBLACK;
m_cellBackgroundColour = *wxWHITE;
m_labelTextColour = *wxBLACK;
// m_labelBackgroundColour = *wxLIGHT_GREY;
m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
- m_labelBackgroundBrush = (wxBrush *) NULL;
- m_labelTextFont = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxBOLD);
- m_cellTextFont = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
+ m_labelBackgroundBrush = wxNullBrush;
+ m_labelTextFont = * wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxBOLD);
+ m_cellTextFont = * wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
m_textItem = (wxTextCtrl *) NULL;
m_currentRectVisible = FALSE;
m_editable = TRUE;
m_dragRowOrCol = 0;
m_dragStartPosition = 0;
m_dragLastPosition = 0;
- m_divisionPen = wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID);
+ m_divisionPen = * wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID);
m_doubleBufferingBitmap = (wxBitmap *) NULL;
- if (!m_horizontalSashCursor)
+ if (!m_horizontalSashCursor.Ok())
{
- m_horizontalSashCursor = new wxCursor(wxCURSOR_SIZEWE);
- m_verticalSashCursor = new wxCursor(wxCURSOR_SIZENS);
+ m_horizontalSashCursor = wxCursor(wxCURSOR_SIZEWE);
+ m_verticalSashCursor = wxCursor(wxCURSOR_SIZENS);
}
SetLabelBackgroundColour(m_labelBackgroundColour);
}
}
-wxGridCell *wxGenericGrid::GetCell(int row, int col)
+wxGridCell *wxGenericGrid::GetCell(int row, int col) const
{
if (!m_gridCells)
return (wxGridCell *) NULL;
if (!cell)
{
// m_gridCells[row][col] = OnCreateCell();
- wxGridEvent g_evt(GetId(), wxEVT_GRID_CREATE_CELL, this, row, col);
+ wxGridEvent g_evt(GetId(), wxEVT_GRID_CREATE_CELL, (wxGenericGrid*) this, row, col);
GetEventHandler()->ProcessEvent(g_evt);
m_gridCells[row][col] = g_evt.m_cell;
return m_gridCells[row][col];
// dc->DrawRectangle(m_rightOfSheet, m_topOfSheet, cw - m_rightOfSheet, ch - m_topOfSheet);
// Paint the label areas
- dc->SetBrush(*m_labelBackgroundBrush);
+ dc->SetBrush(m_labelBackgroundBrush);
// dc->DrawRectangle(m_leftOfSheet, m_topOfSheet, m_rightOfSheet - m_leftOfSheet + 1, m_horizontalLabelHeight + 1);
dc->DrawRectangle(m_leftOfSheet, m_topOfSheet, cw-m_leftOfSheet, m_horizontalLabelHeight + 1);
// dc->DrawRectangle(m_leftOfSheet, m_topOfSheet, m_verticalLabelWidth + 1, m_bottomOfSheet - m_topOfSheet + 1);
int i;
- if (m_divisionPen)
+ if (m_divisionPen.Ok())
{
- dc->SetPen(*m_divisionPen);
+ dc->SetPen(m_divisionPen);
int heightCount = m_topOfSheet + m_horizontalLabelHeight;
}
- if (m_divisionPen)
+ if (m_divisionPen.Ok())
{
- dc->SetPen(*m_divisionPen);
+ dc->SetPen(m_divisionPen);
// Draw vertical grey lines for cells
int widthCount = m_leftOfSheet + m_verticalLabelWidth;
rect2.width -= 5;
rect2.height -= 4;
dc->SetTextForeground(GetLabelTextColour());
- dc->SetFont(*GetLabelTextFont());
+ dc->SetFont(GetLabelTextFont());
if ( !cell->GetTextValue().IsNull() )
DrawTextRect(dc, cell->GetTextValue(), &rect2, GetLabelAlignment(wxHORIZONTAL));
}
rect2.width -= 5;
rect2.height -= 4;
dc->SetTextForeground(GetLabelTextColour());
- dc->SetFont(*GetLabelTextFont());
+ dc->SetFont(GetLabelTextFont());
if ( !cell->GetTextValue().IsNull() )
DrawTextRect(dc, cell->GetTextValue(), &rect2, GetLabelAlignment(wxVERTICAL));
}
wxGridCell *cell = GetCell(row, col);
if (cell)
{
- dc->SetBrush(*cell->GetBackgroundBrush());
+ dc->SetBrush(cell->GetBackgroundBrush());
dc->SetPen(*wxTRANSPARENT_PEN);
#if 0 // In wxWin 2.0 the dc code is exact. RR.
{
dc->SetBackgroundMode(wxTRANSPARENT);
dc->SetTextForeground(cell->GetTextColour());
- dc->SetFont(*cell->GetFont());
+ dc->SetFont(cell->GetFont());
if ( !cell->GetTextValue().IsNull() )
DrawTextRect(dc, cell->GetTextValue(), &rect2, cell->GetAlignment());
if (orientation == wxHORIZONTAL)
{
m_dragStatus = wxGRID_DRAG_LEFT_RIGHT;
- SetCursor(*m_horizontalSashCursor);
+ SetCursor(m_horizontalSashCursor);
m_dragLastPosition = (int)ev.GetX();
}
else
{
m_dragStatus = wxGRID_DRAG_UP_DOWN;
- SetCursor(*m_verticalSashCursor);
+ SetCursor(m_verticalSashCursor);
m_dragLastPosition = (int)ev.GetY();
}
wxClientDC dc(this);
dc.EndDrawing();
m_dragLastPosition = (int)ev.GetX();
- SetCursor(*m_horizontalSashCursor);
+ SetCursor(m_horizontalSashCursor);
break;
}
case wxGRID_DRAG_UP_DOWN:
dc.EndDrawing();
m_dragLastPosition = (int)ev.GetY();
- SetCursor(*m_verticalSashCursor);
+ SetCursor(m_verticalSashCursor);
break;
}
}
if (LabelSashHitTest((int)ev.GetX(), (int)ev.GetY(), &orientation, &rowOrCol, &startPos))
{
if (orientation == wxHORIZONTAL)
- SetCursor(*m_horizontalSashCursor);
+ SetCursor(m_horizontalSashCursor);
else
- SetCursor(*m_verticalSashCursor);
+ SetCursor(m_verticalSashCursor);
}
else
SetCursor(*wxSTANDARD_CURSOR);
SetGridClippingRegion(& dc);
dc.SetBackgroundMode(wxTRANSPARENT);
- dc.SetBrush(*cell->GetBackgroundBrush());
+ dc.SetBrush(cell->GetBackgroundBrush());
strcpy(szEdit, m_textItem->GetValue());
}
}
-wxString& wxGenericGrid::GetCellValue(int row, int col)
+wxString& wxGenericGrid::GetCellValue(int row, int col) const
{
static wxString emptyString("");
m_colWidths[col] = width;
}
-int wxGenericGrid::GetColumnWidth(int col)
+int wxGenericGrid::GetColumnWidth(int col) const
{
if (col <= m_totalCols)
return m_colWidths[col];
m_rowHeights[row] = height;
}
-int wxGenericGrid::GetRowHeight(int row)
+int wxGenericGrid::GetRowHeight(int row) const
{
if (row <= m_totalRows)
return m_rowHeights[row];
SetCurrentRect(GetCursorRow(), GetCursorColumn());
}
-int wxGenericGrid::GetLabelSize(int orientation)
+int wxGenericGrid::GetLabelSize(int orientation) const
{
if (orientation == wxHORIZONTAL)
return m_horizontalLabelHeight;
return m_verticalLabelWidth;
}
-wxGridCell *wxGenericGrid::GetLabelCell(int orientation, int pos)
+wxGridCell *wxGenericGrid::GetLabelCell(int orientation, int pos) const
{
if (orientation == wxHORIZONTAL)
{
cell->SetTextValue(val);
}
-wxString& wxGenericGrid::GetLabelValue(int orientation, int pos)
+wxString& wxGenericGrid::GetLabelValue(int orientation, int pos) const
{
static wxString emptyString = "";
wxGridCell *cell = GetLabelCell(orientation, pos);
SetCurrentRect(GetCursorRow(), GetCursorColumn());
}
-int wxGenericGrid::GetLabelAlignment(int orientation)
+int wxGenericGrid::GetLabelAlignment(int orientation) const
{
if (orientation == wxHORIZONTAL)
return m_horizontalLabelAlignment;
void wxGenericGrid::SetLabelBackgroundColour(const wxColour& colour)
{
m_labelBackgroundColour = colour;
- m_labelBackgroundBrush = wxTheBrushList->FindOrCreateBrush(m_labelBackgroundColour, wxSOLID);
+ m_labelBackgroundBrush = * wxTheBrushList->FindOrCreateBrush(m_labelBackgroundColour, wxSOLID);
}
void wxGenericGrid::SetEditable(bool edit)
cell->SetAlignment(flag);
}
-int wxGenericGrid::GetCellAlignment(int row, int col)
+int wxGenericGrid::GetCellAlignment(int row, int col) const
{
wxGridCell *cell = GetCell(row, col);
if (cell)
GetCell(i, j)->SetAlignment(flag);
}
-int wxGenericGrid::GetCellAlignment(void)
+int wxGenericGrid::GetCellAlignment(void) const
{
return m_cellAlignment;
}
}
}
-wxColour& wxGenericGrid::GetCellBackgroundColour(int row, int col)
+wxColour& wxGenericGrid::GetCellBackgroundColour(int row, int col) const
{
wxGridCell *cell = GetCell(row, col);
if (cell)
return cell->GetBackgroundColour();
else
- return m_cellBackgroundColour;
+ return (wxColour&) m_cellBackgroundColour;
}
void wxGenericGrid::SetCellTextColour(const wxColour& val, int row, int col)
}
}
-void wxGenericGrid::SetCellTextFont(wxFont *fnt, int row, int col)
+void wxGenericGrid::SetCellTextFont(const wxFont& fnt, int row, int col)
{
wxGridCell *cell = GetCell(row, col);
if (cell)
}
}
-wxFont *wxGenericGrid::GetCellTextFont(int row, int col)
+wxFont& wxGenericGrid::GetCellTextFont(int row, int col) const
{
wxGridCell *cell = GetCell(row, col);
if (cell)
- return cell->GetFont();
+ return (wxFont&) cell->GetFont();
else
- return m_cellTextFont;
+ return (wxFont&) m_cellTextFont;
}
-wxColour& wxGenericGrid::GetCellTextColour(int row, int col)
+wxColour& wxGenericGrid::GetCellTextColour(int row, int col) const
{
wxGridCell *cell = GetCell(row, col);
if (cell)
- return cell->GetTextColour();
+ return (wxColour&) cell->GetTextColour();
else
- return m_cellTextColour;
+ return (wxColour&) m_cellTextColour;
}
void wxGenericGrid::SetCellTextColour(const wxColour& val)
GetCell(i, j)->SetTextColour(val);
}
-void wxGenericGrid::SetCellTextFont(wxFont *fnt)
+void wxGenericGrid::SetCellTextFont(const wxFont& fnt)
{
m_cellTextFont = fnt;
int i,j;
}
}
-wxBitmap *wxGenericGrid::GetCellBitmap(int row, int col)
+wxBitmap *wxGenericGrid::GetCellBitmap(int row, int col) const
{
wxGridCell *cell = GetCell(row, col);
if (cell)
wxGridCell::wxGridCell(wxGenericGrid *window)
{
cellBitmap = (wxBitmap *) NULL;
- font = (wxFont *) NULL;
- backgroundBrush = (wxBrush *) NULL;
+ font = wxNullFont;
+ backgroundBrush = wxNullBrush;
if (window)
textColour = window->GetCellTextColour();
else
if (window)
font = window->GetCellTextFont();
else
- font = wxTheFontList->FindOrCreateFont(12, wxSWISS, wxNORMAL, wxNORMAL);
+ font = * wxTheFontList->FindOrCreateFont(12, wxSWISS, wxNORMAL, wxNORMAL);
SetBackgroundColour(backgroundColour);
void wxGridCell::SetBackgroundColour(const wxColour& colour)
{
backgroundColour = colour;
- backgroundBrush = wxTheBrushList->FindOrCreateBrush(backgroundColour, wxSOLID);
+ backgroundBrush = * wxTheBrushList->FindOrCreateBrush(backgroundColour, wxSOLID);
}
void wxGenericGrid::OnText(wxCommandEvent& WXUNUSED(ev) )
wxCalculateLayoutEvent event;
event.SetRect(rect);
- wxNode* node = frame->GetChildren()->First();
+ wxNode* node = frame->GetChildren().First();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
wxCalculateLayoutEvent event;
event.SetRect(rect);
- wxNode* node = frame->GetChildren()->First();
+ wxNode* node = frame->GetChildren().First();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
{
if (hilight)
{
- dc->SetBrush( m_hilightBrush );
- dc->SetPen( wxTRANSPARENT_PEN );
+ dc->SetBrush( * m_hilightBrush );
+ dc->SetPen( * wxTRANSPARENT_PEN );
}
else
{
- dc->SetBrush( wxWHITE_BRUSH );
- dc->SetPen( wxTRANSPARENT_PEN );
+ dc->SetBrush( * wxWHITE_BRUSH );
+ dc->SetPen( * wxTRANSPARENT_PEN );
}
dc->DrawRectangle( m_bound_hilight.x, m_bound_hilight.y,
m_bound_hilight.width, m_bound_hilight.height );
{
if (on)
{
- dc->SetPen( wxBLACK_PEN );
- dc->SetBrush( wxTRANSPARENT_BRUSH );
+ dc->SetPen( * wxBLACK_PEN );
+ dc->SetBrush( * wxTRANSPARENT_BRUSH );
dc->DrawRectangle( m_bound_hilight.x, m_bound_hilight.y,
m_bound_hilight.width, m_bound_hilight.height );
}
dc.BeginDrawing();
- dc.SetFont( *GetFont() );
+ dc.SetFont( GetFont() );
int w = 0;
int h = 0;
{
if (hit_border)
{
- if (m_currentCursor == wxSTANDARD_CURSOR) SetCursor( m_resizeCursor );
+ if (m_currentCursor == wxSTANDARD_CURSOR) SetCursor( * m_resizeCursor );
m_currentCursor = m_resizeCursor;
}
else
{
- if (m_currentCursor != wxSTANDARD_CURSOR) SetCursor( wxSTANDARD_CURSOR );
+ if (m_currentCursor != wxSTANDARD_CURSOR) SetCursor( * wxSTANDARD_CURSOR );
m_currentCursor = wxSTANDARD_CURSOR;
}
}
dc.BeginDrawing();
- dc.SetFont( *GetFont() );
+ dc.SetFont( GetFont() );
wxNode *node = m_lines.First();
while (node)
if (!m_lines.First()) return;
wxPaintDC dc( this );
- dc.SetFont( *GetFont() );
+ dc.SetFont( GetFont() );
int iconSpacing = 0;
if (m_mode & wxLC_ICON) iconSpacing = m_normal_spacing;
}
// first of all, find the window which currently has the focus
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
wxWindow *winFocus = event.GetCurrentFocus();
// @@@ no FindFocus() in wxGTK
bool bFound = FALSE; // have we found a window we will set focus to?
- wxList *children = GetChildren();
+ wxList *children = & GetChildren();
if ( node == NULL ) {
// we've never had focus before
node = bForward ? children->First() : children->Last();
int cw, ch;
GetClientSize(&cw, &ch);
- if (GetChildren()->Number() > 0)
+ if (GetChildren().Number() > 0)
{
- wxWindow* child = (wxWindow*) (GetChildren()->First()->Data());
+ wxWindow* child = (wxWindow*) (GetChildren().First()->Data());
int x = 0;
int y = 0;
bool success = wxWindow::Create(parent, id, pos, size, style, name);
// Don't wish this to be found as a child
- parent->GetChildren()->DeleteObject(this);
+ parent->GetChildren().DeleteObject(this);
InitColours();
wxPaintDC dc(this);
int i;
- if ( GetFont() )
- dc.SetFont(*GetFont());
+ if ( GetFont().Ok() )
+ dc.SetFont(GetFont());
dc.SetBackgroundMode(wxTRANSPARENT);
for ( i = 0; i < m_nFields; i ++ )
#ifndef wxUSE_NEW_METHOD
if (GetTabStyle() & wxTAB_STYLE_DRAW_BOX)
{
- dc.SetPen(GetShadowPen());
+ dc.SetPen(* GetShadowPen());
// Draw bottom line
dc.DrawLine(
(GetViewRect().y + GetViewRect().height)
);
- dc.SetPen(wxBLACK_PEN);
+ dc.SetPen(* wxBLACK_PEN);
// Draw bottom line
dc.DrawLine(
if (event.MoreRequested())
needMore = TRUE;
- wxNode* node = win->GetChildren()->First();
+ wxNode* node = win->GetChildren().First();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
// Because it's very hard to find wxButton in the same row,
// correction is straighforward: we set resource for all wxButton
// in this parent (but not sub panels)
- for (wxNode * node = parent->GetChildren ()->First (); node; node = node->Next ())
+ for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
{
wxButton *item = (wxButton *) node->Data ();
if (item->IsKindOf(CLASSINFO(wxButton)))
{
// this is a bit artificial, but we need to force wxDC to think
// the pen has changed
- wxPen* pen = GetPen();
+ wxPen* pen = & GetPen();
wxPen tempPen;
m_pen = tempPen;
- SetPen(pen);
+ SetPen(* pen);
}
};
m_currentPenDash = m_pen.GetDash();
if (m_currentStyle == wxSTIPPLE)
- m_currentStipple = m_pen.GetStipple ();
+ m_currentStipple = * m_pen.GetStipple ();
bool sameStyle = (oldStyle == m_currentStyle &&
oldFill == m_currentFill &&
{
Pixmap myStipple;
- oldStipple = (wxBitmap*) NULL; // For later reset!!
+ oldStipple = wxNullBitmap; // For later reset!!
switch (m_currentFill)
{
m_currentFill = m_brush.GetStyle ();
if (m_currentFill == wxSTIPPLE)
- m_currentStipple = m_brush.GetStipple ();
+ m_currentStipple = * m_brush.GetStipple ();
wxColour oldBrushColour(m_currentColour);
m_currentColour = m_brush.GetColour ();
XGCValues valReturn;
XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn);
m_oldFont = (WXFont) valReturn.font;
- SetBrush (wxWHITE_BRUSH);
- SetPen (wxBLACK_PEN);
+ SetBrush (* wxWHITE_BRUSH);
+ SetPen (* wxBLACK_PEN);
};
wxMemoryDC::wxMemoryDC( wxDC* dc )
XGCValues valReturn;
XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn);
m_oldFont = (WXFont) valReturn.font;
- SetBrush (wxWHITE_BRUSH);
- SetPen (wxBLACK_PEN);
+ SetBrush (* wxWHITE_BRUSH);
+ SetPen (* wxBLACK_PEN);
};
wxMemoryDC::~wxMemoryDC(void)
bool oldOpt = GetOptimization();
SetOptimization(FALSE);
- SetBrush (wxWHITE_BRUSH);
- SetPen (wxBLACK_PEN);
+ SetBrush (* wxWHITE_BRUSH);
+ SetPen (* wxBLACK_PEN);
SetOptimization(oldOpt);
// it seems that if a frame holds a panel, the menu bar size
// gets automatically taken care of --- grano@cs.helsinki.fi 4.4.95
bool hasSubPanel = FALSE;
- for(wxNode* node = GetChildren()->First(); node; node = node->Next())
+ for(wxNode* node = GetChildren().First(); node; node = node->Next())
{
wxWindow *win = (wxWindow *)node->Data();
hasSubPanel = (win->IsKindOf(CLASSINFO(wxPanel)) && !win->IsKindOf(CLASSINFO(wxDialog)));
// Set the height according to the font and the border size
wxClientDC dc(statusBar);
- dc.SetFont(* statusBar->GetFont());
+ dc.SetFont(statusBar->GetFont());
long x, y;
dc.GetTextExtent("X", &x, &y);
void wxFrame::Fit()
{
// Work out max. size
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
int max_width = 0;
int max_height = 0;
while (node)
// do we have _exactly_ one child?
wxWindow *child = NULL;
- for ( wxNode *node = GetChildren()->First(); node; node = node->Next() )
+ for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
{
wxWindow *win = (wxWindow *)node->Data();
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
// subwindow found.
void wxFrame::OnActivate(wxActivateEvent& event)
{
- for(wxNode *node = GetChildren()->First(); node; node = node->Next())
+ for(wxNode *node = GetChildren().First(); node; node = node->Next())
{
// Find a child that's a subwindow, but not a dialog box.
wxWindow *child = (wxWindow *)node->Data();
EVT_MOUSE_EVENTS(wxNotebook::OnMouseEvent)
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
+ EVT_IDLE(wxNotebook::OnIdle)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
event.Skip();
}
+// This was supposed to cure the non-display of the notebook
+// until the user resizes the window.
+// What's going on?
+void wxNotebook::OnIdle(wxIdleEvent& event)
+{
+ static bool s_bFirstTime = TRUE;
+ if ( s_bFirstTime ) {
+ wxSize sz(GetSize());
+ wxSizeEvent sizeEvent(sz, GetId());
+ sizeEvent.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(sizeEvent);
+ Refresh();
+ s_bFirstTime = FALSE;
+ }
+ event.Skip();
+}
+
// Implementation: calculate the layout of the view rect
// and resize the children if required
bool wxNotebook::RefreshLayout(bool force)
void wxScrollBar::Command(wxCommandEvent& event)
{
- SetPosition(event.m_commandInt);
+ SetThumbPosition(event.m_commandInt);
ProcessCommand(event);
}
wxToolBarTool *wxToolBar::AddTool(int index, const wxBitmap& bitmap, const wxBitmap& pushedBitmap,
bool toggle, long xPos, long yPos, wxObject *clientData, const wxString& helpString1, const wxString& helpString2)
{
- wxToolBarTool *tool = new wxToolBarTool(index, bitmap, (wxBitmap *)NULL, toggle, xPos, yPos, helpString1, helpString2);
+ wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2);
tool->m_clientData = clientData;
if (xPos > -1)
XFlush (display);
- for(wxNode *node = win->GetChildren()->First (); node; node = node->Next())
+ for(wxNode *node = win->GetChildren().First (); node; node = node->Next())
{
wxWindow *child = (wxWindow *) node->Data ();
wxXSetBusyCursor (child, cursor);
// Responds to colour changes: passes event on to children.
void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
// Only propagate to non-top-level windows
// it's an application error (pops up a dialog)
bool wxWindow::TransferDataToWindow()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
// validation failed: don't quit
bool wxWindow::TransferDataFromWindow()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
bool wxWindow::Validate()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
void wxWindow::AddChild(wxWindow *child)
{
- GetChildren()->Append(child);
+ GetChildren().Append(child);
child->m_windowParent = this;
}
void wxWindow::RemoveChild(wxWindow *child)
{
- if (GetChildren())
- GetChildren()->DeleteObject(child);
+ GetChildren().DeleteObject(child);
child->m_windowParent = NULL;
}
void wxWindow::DestroyChildren()
{
- if (GetChildren())
- {
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxNode* next = node->Next();
delete child;
node = next;
}
- GetChildren()->Clear();
+ GetChildren().Clear();
#if 0
wxNode *node;
- while ((node = GetChildren()->First()) != (wxNode *)NULL) {
+ while ((node = GetChildren().First()) != (wxNode *)NULL) {
wxWindow *child;
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) {
delete child;
- if ( GetChildren()->Member(child) )
+ if ( GetChildren().Member(child) )
delete node;
}
} /* while */
#endif
- }
}
void wxWindow::MakeModal(bool modal)
{
noChanges = 0;
noFailures = 0;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
constr->centreX.SetDone(FALSE);
constr->centreY.SetDone(FALSE);
}
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
if (recurse)
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
wxObject* wxWindow::GetChild(int number) const
{
// Return a pointer to the Nth object in the window
- if (!GetChildren())
- return(NULL) ;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
int n = number;
while (node && n--)
node = node->Next() ;
{
int maxX = 0;
int maxY = 0;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *win = (wxWindow *)node->Data();
if ( GetId() == id)
return this;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
if ( GetName() == name)
return this;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
if (event.MoreRequested())
needMore = TRUE;
- wxNode* node = win->GetChildren()->First();
+ wxNode* node = win->GetChildren().First();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
*/
if( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) )
{
- tmpBitmap.SetPalette(this->GetPalette());
+ tmpBitmap.SetPalette(* this->GetPalette());
memDC.SelectObject(tmpBitmap);
- memDC.SetPalette(this->GetPalette());
+ memDC.SetPalette(* this->GetPalette());
hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
}
else
// Subclass again for purposes of dialog editing mode
SubclassWin((WXHWND)wx_button);
- SetFont(* parent->GetFont()) ;
+ SetFont(parent->GetFont()) ;
SetSize(x, y, width, height);
ShowWindow(wx_button, SW_SHOW);
// Subclass again for purposes of dialog editing mode
SubclassWin((WXHWND)wx_button);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
SetSize(x, y, width, height);
ShowWindow(wx_button, SW_SHOW);
int cyf;
char buf[300];
GetWindowText((HWND) GetHWND(), buf, 300);
- GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL,GetFont());
+ GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL,& GetFont());
// If we're prepared to use the existing width, then...
if (width == -1 && ((sizeFlags & wxSIZE_AUTO_WIDTH) != wxSIZE_AUTO_WIDTH))
{
int cx;
int cy;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy,& GetFont());
actualWidth = (int)(current_width + 3*cx) ;
}
// Subclass again for purposes of dialog editing mode
SubclassWin(m_hWnd);
- SetFont(*parent->GetFont());
+ SetFont(parent->GetFont());
SetSize(x, y, width, height);
if ( !str.IsEmpty() )
{
- GetTextExtent(str, ¤t_width, &cyf, NULL, NULL, GetFont());
+ GetTextExtent(str, ¤t_width, &cyf, NULL, NULL, & GetFont());
if (w1 < 0)
w1 = (int)(current_width + RADIO_SIZE);
if (h1 < 0)
// Subclass again for purposes of dialog editing mode
SubclassWin(m_hWnd);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
int i;
for (i = 0; i < n; i++)
int cx; // button font dimensions
int cy;
- wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
int control_width, control_height;
for (i = 0; i < m_noStrings; i++)
{
wxString str(GetString(i));
- GetTextExtent(str, &len, &ht, NULL, NULL,GetFont());
+ GetTextExtent(str, &len, &ht, NULL, NULL, & GetFont());
if ( len > longest)
longest = len;
}
// Subclass again for purposes of dialog editing mode
SubclassWin(m_hWnd);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
int i;
for (i = 0; i < n; i++)
{
// Set the height according to the font and the border size
wxClientDC dc(statusBar);
- dc.SetFont(* statusBar->GetFont());
+ dc.SetFont(statusBar->GetFont());
long x, y;
dc.GetTextExtent("X", &x, &y);
void wxFrame::Fit(void)
{
// Work out max. size
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
int max_width = 0;
int max_height = 0;
while (node)
// do we have _exactly_ one child?
wxWindow *child = NULL;
- for ( wxNode *node = GetChildren()->First(); node; node = node->Next() )
+ for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
{
wxWindow *win = (wxWindow *)node->Data();
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
// subwindow found.
void wxFrame::OnActivate(wxActivateEvent& event)
{
- for(wxNode *node = GetChildren()->First(); node; node = node->Next())
+ for(wxNode *node = GetChildren().First(); node; node = node->Next())
{
// Find a child that's a subwindow, but not a dialog box.
wxWindow *child = (wxWindow *)node->Data();
// propagate our state change to all child frames
void wxFrame::IconizeChildFrames(bool bIconize)
{
- for ( wxNode *node = GetChildren()->First(); node; node = node->Next() ) {
+ for ( wxNode *node = GetChildren().First(); node; node = node->Next() ) {
wxWindow *win = (wxWindow *)node->Data();
if ( win->IsKindOf(CLASSINFO(wxFrame)) ) {
((wxFrame *)win)->Iconize(bIconize);
SendMessage((HWND) GetHWND(), PBM_SETRANGE, 0, MAKELPARAM(0, range));
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
if (width == -1)
width = 50;
SendMessage((HWND) GetHWND(), ZYZG_SETFGCOLOR, 0, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
SendMessage((HWND) GetHWND(), ZYZG_SETBKCOLOR, 0, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
if (width == -1)
width = 50;
if ( solidBackground )
{
- wxBrush *brush = dc.GetBackground();
+ wxBrush *brush = & dc.GetBackground();
if ( brush && brush->Ok())
{
wxColour col(brush->GetColour());
if ( (m_windowStyle & wxLB_MULTIPLE) == 0 )
SendMessage(hwnd, LB_SETCURSEL, 0, 0);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
SetSize(x, y, width, height);
int cx; // button font dimensions
int cy;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
float control_width, control_height, control_x, control_y;
int existingExtent = (int)SendMessage(hwnd, LB_GETHORIZONTALEXTENT, 0, 0L);
HDC dc = GetWindowDC(hwnd);
HFONT oldFont = 0;
- if (GetFont() && GetFont()->GetResourceHandle())
- oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
+ if (GetFont().Ok() && GetFont().GetResourceHandle())
+ oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle());
GetTextMetrics(dc, &lpTextMetric);
SIZE extentXY;
int largestExtent = 0;
HDC dc = GetWindowDC(hwnd);
HFONT oldFont = 0;
- if (GetFont() && GetFont()->GetResourceHandle())
- oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
+ if (GetFont().Ok() && GetFont().GetResourceHandle())
+ oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle());
GetTextMetrics(dc, &lpTextMetric);
int i;
}
if (id >= wxFIRST_MDI_CHILD && id <= wxLAST_MDI_CHILD)
{
- wxNode* node = GetChildren()->First();
+ wxNode* node = GetChildren().First();
while (node)
{
wxWindow* child = (wxWindow*) node->Data();
if ( m_windowId == id )
return this;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow* child = (wxWindow*) node->Data();
}
#endif
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
SubclassWin((WXHWND)m_hWnd);
m_useCtl3D = TRUE;
}
#endif
- if (GetFont())
+ if (GetFont().Ok())
{
SendMessage((HWND)m_radioButtons[i],WM_SETFONT,
- (WPARAM)GetFont()->GetResourceHandle(),0L);
+ (WPARAM)GetFont().GetResourceHandle(),0L);
}
m_subControls.Append((wxObject *)newId);
}
}
#endif
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
// Subclass again for purposes of dialog editing mode
SubclassWin((WXHWND)m_hWnd);
int current_width, cyf;
int cx1,cy1 ;
- wxGetCharSize(m_hWnd, &cx1, &cy1, GetFont());
+ wxGetCharSize(m_hWnd, &cx1, &cy1, & GetFont());
// Attempt to have a look coherent with other platforms:
// We compute the biggest toggle dim, then we align all
// items according this value.
{
// It's a labelled toggle
GetWindowText((HWND) m_radioButtons[i], buf, 300);
- GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL, GetFont());
+ GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL, & GetFont());
eachWidth = (int)(current_width + RADIO_SIZE);
eachHeight = (int)((3*cyf)/2);
}
{
// It's a labeled item
GetWindowText((HWND) m_radioButtons[i], buf, 300);
- GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL,GetFont());
+ GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL, & GetFont());
// How do we find out radio button bitmap size!!
// By adjusting them carefully, manually :-)
}
#endif
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
// Subclass again for purposes of dialog editing mode
SubclassWin((WXHWND)m_hWnd);
if (label != "")
{
int label_width, label_height;
- GetTextExtent(label, &label_width, &label_height, NULL, NULL, GetFont());
+ GetTextExtent(label, &label_width, &label_height, NULL, NULL, & GetFont());
if (width < 0)
width = (int)(label_width + RADIO_SIZE);
if (height<0)
::SetScrollPos(scroll_bar, SB_CTL, 0, FALSE);
ShowWindow(scroll_bar, SW_SHOW);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
m_hWnd = (WXHWND)scroll_bar;
SetWindowText((HWND) m_hWnd, "");
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
if ( m_windowStyle & wxSL_LABELS )
{
wxGetInstance(), NULL);
- if (GetFont())
+ if (GetFont().Ok())
{
-// GetFont()->RealizeResource();
- if (GetFont()->GetResourceHandle())
+ if (GetFont().GetResourceHandle())
{
if ( m_staticMin )
SendMessage((HWND)m_staticMin,WM_SETFONT,
- (WPARAM)GetFont()->GetResourceHandle(),0L);
+ (WPARAM)GetFont().GetResourceHandle(),0L);
if ( m_staticMax )
SendMessage((HWND)m_staticMax,WM_SETFONT,
- (WPARAM)GetFont()->GetResourceHandle(),0L);
+ (WPARAM)GetFont().GetResourceHandle(),0L);
if (m_staticValue)
SendMessage((HWND)m_staticValue,WM_SETFONT,
- (WPARAM)GetFont()->GetResourceHandle(),0L);
+ (WPARAM)GetFont().GetResourceHandle(),0L);
}
}
}
int cy;
int cyf;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
{
int min_len = 0;
GetWindowText((HWND) m_staticMin, buf, 300);
- GetTextExtent(buf, &min_len, &cyf,NULL,NULL, GetFont());
+ GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & GetFont());
int max_len = 0;
GetWindowText((HWND) m_staticMax, buf, 300);
- GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
+ GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
if (m_staticValue)
{
int new_width = (int)(wxMax(min_len, max_len));
{
int min_len;
GetWindowText((HWND) m_staticMin, buf, 300);
- GetTextExtent(buf, &min_len, &cyf,NULL,NULL,GetFont());
+ GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & GetFont());
int max_len;
GetWindowText((HWND) m_staticMax, buf, 300);
- GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
+ GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
if (m_staticValue)
{
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
- if (GetFont())
+ if (GetFont().Ok())
{
// GetFont()->RealizeResource();
- if (GetFont()->GetResourceHandle())
+ if (GetFont().GetResourceHandle())
{
if ( m_staticMin )
SendMessage((HWND)m_staticMin,WM_SETFONT,
- (WPARAM)GetFont()->GetResourceHandle(),0L);
+ (WPARAM)GetFont().GetResourceHandle(),0L);
if ( m_staticMax )
SendMessage((HWND)m_staticMax,WM_SETFONT,
- (WPARAM)GetFont()->GetResourceHandle(),0L);
+ (WPARAM)GetFont().GetResourceHandle(),0L);
if (m_staticValue)
SendMessage((HWND)m_staticValue,WM_SETFONT,
- (WPARAM)GetFont()->GetResourceHandle(),0L);
+ (WPARAM)GetFont().GetResourceHandle(),0L);
}
}
int cy;
int cyf;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy,& GetFont());
if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
{
int min_len = 0;
GetWindowText((HWND) m_staticMin, buf, 300);
- GetTextExtent(buf, &min_len, &cyf,NULL,NULL, GetFont());
+ GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & GetFont());
int max_len = 0;
GetWindowText((HWND) m_staticMax, buf, 300);
- GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
+ GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
if (m_staticValue)
{
int new_width = (int)(wxMax(min_len, max_len));
{
int min_len;
GetWindowText((HWND) m_staticMin, buf, 300);
- GetTextExtent(buf, &min_len, &cyf,NULL,NULL,GetFont());
+ GetTextExtent(buf, &min_len, &cyf,NULL,NULL,& GetFont());
int max_len;
GetWindowText((HWND) m_staticMax, buf, 300);
- GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
+ GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
if (m_staticValue)
{
// Subclass again for purposes of dialog editing mode
SubclassWin(m_hWnd);
- SetFont(* GetParent()->GetFont());
+ SetFont(GetParent()->GetFont());
SetSize(x, y, width, height);
return TRUE;
// Subclass again for purposes of dialog editing mode
SubclassWin(GetHWND());
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
SetSize(x, y, width, height);
ShowWindow(wx_button, SW_SHOW);
int cy;
int cyf;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
GetTextExtent(wxGetWindowText(m_hWnd), ¤t_width, &cyf,
- NULL,NULL,GetFont());
+ NULL,NULL, & GetFont());
if ( w1 < 0 )
w1 = current_width + 3*cx;
if ( h1 < 0 )
SubclassWin(m_hWnd);
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
SetSize(x, y, width, height);
return TRUE;
int cyf;
::GetWindowText((HWND) GetHWND(), buf, 300);
- GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL,GetFont());
+ GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL, & GetFont());
int ww, hh;
GetSize(&ww, &hh);
{
int cx;
int cy;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
actualWidth = (int)(current_width + cx) ;
}
::ScreenToClient((HWND) parent->GetHWND(), &point);
}
- GetTextExtent(label, &w, &h, NULL, NULL, GetFont());
+ GetTextExtent(label, &w, &h, NULL, NULL, & GetFont());
MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h,
TRUE);
SetWindowText((HWND) GetHWND(), (const char *)label);
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, *bitmap2, toggle, xPos, yPos, helpString1, helpString2);
#else
- wxToolBarTool *tool = new wxToolBarTool(index, bitmap, (wxBitmap *)NULL, toggle, xPos, yPos, helpString1, helpString2);
+ wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2);
#endif
tool->m_clientData = clientData;
SubclassWin(GetHWND());
- if ( parent->GetFont() && parent->GetFont()->Ok() )
+ if ( parent->GetFont().Ok() && parent->GetFont().Ok() )
{
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
}
else
{
int cx; // button font dimensions
int cy;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
int control_width, control_height, control_x, control_y;
// Find an item given the MS Windows id
wxWindow *wxWindow::FindItem(int id) const
{
- if (!GetChildren())
- return NULL;
- wxNode *current = GetChildren()->First();
+// if (!GetChildren())
+// return NULL;
+ wxNode *current = GetChildren().First();
while (current)
{
wxWindow *childWin = (wxWindow *)current->Data();
// Find an item given the MS Windows handle
wxWindow *wxWindow::FindItemByHWND(WXHWND hWnd, bool controlOnly) const
{
- if (!GetChildren())
- return NULL;
- wxNode *current = GetChildren()->First();
+// if (!GetChildren())
+// return NULL;
+ wxNode *current = GetChildren().First();
while (current)
{
wxObject *obj = (wxObject *)current->Data() ;
{
// Rely on MSWNotify to check whether the message
// belongs to the window or not
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
// Responds to colour changes: passes event on to children.
void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
// Only propagate to non-top-level windows
// it's an application error (pops up a dialog)
bool wxWindow::TransferDataToWindow()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
// validation failed: don't quit
bool wxWindow::TransferDataFromWindow()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
bool wxWindow::Validate()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
void wxWindow::AddChild(wxWindow *child)
{
- GetChildren()->Append(child);
+ GetChildren().Append(child);
child->m_windowParent = this;
}
void wxWindow::RemoveChild(wxWindow *child)
{
- if (GetChildren())
- GetChildren()->DeleteObject(child);
+// if (GetChildren())
+ GetChildren().DeleteObject(child);
child->m_windowParent = NULL;
}
void wxWindow::DestroyChildren()
{
- if (GetChildren()) {
wxNode *node;
- while ((node = GetChildren()->First()) != (wxNode *)NULL) {
+ while ((node = GetChildren().First()) != (wxNode *)NULL) {
wxWindow *child;
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) {
delete child;
- if ( GetChildren()->Member(child) )
+ if ( GetChildren().Member(child) )
delete node;
}
} /* while */
- }
}
void wxWindow::MakeModal(bool modal)
{
noChanges = 0;
noFailures = 0;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
constr->centreX.SetDone(FALSE);
constr->centreY.SetDone(FALSE);
}
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
if (recurse)
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
wxObject* wxWindow::GetChild(int number) const
{
// Return a pointer to the Nth object in the Panel
- if (!GetChildren())
- return(NULL) ;
- wxNode *node = GetChildren()->First();
+// if (!GetChildren())
+// return(NULL) ;
+ wxNode *node = GetChildren().First();
int n = number;
while (node && n--)
node = node->Next() ;
{
int maxX = 0;
int maxY = 0;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *win = (wxWindow *)node->Data();
if ( GetId() == id)
return this;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
if ( GetName() == name)
return this;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
if (event.MoreRequested())
needMore = TRUE;
- wxNode* node = win->GetChildren()->First();
+ wxNode* node = win->GetChildren().First();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
SetValidator(validator);
parent->AddChild(this);
- m_backgroundColour = parent->GetDefaultBackgroundColour() ;
- m_foregroundColour = parent->GetDefaultForegroundColour() ;
+ m_backgroundColour = parent->GetBackgroundColour() ;
+ m_foregroundColour = parent->GetForegroundColour() ;
m_windowStyle = style;
m_marginX = 0;
m_marginY = 0;
#include "wx/wx.h"
+#if wxUSE_POSTSCRIPT
+#include "wx/postscrp.h"
+#endif
+
#define _MAXPATHLEN 500
// Useful buffer, initialized in CommonInit
{
// this is a bit artificial, but we need to force wxDC to think
// the pen has changed
- wxPen* pen = GetPen();
+ wxPen* pen = & GetPen();
wxPen tempPen;
m_pen = tempPen;
- SetPen(pen);
+ SetPen(* pen);
}
};
#include "wx/dcclient.h"
#include "wx/dcmemory.h"
+#include "wx/region.h"
#include <math.h>
//-----------------------------------------------------------------------------
// Set the height according to the font and the border size
wxClientDC dc(statusBar);
- dc.SetFont(* statusBar->GetFont());
+ dc.SetFont(statusBar->GetFont());
long x, y;
dc.GetTextExtent("X", &x, &y);
void wxFrame::Fit()
{
// Work out max. size
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
int max_width = 0;
int max_height = 0;
while (node)
// do we have _exactly_ one child?
wxWindow *child = NULL;
- for ( wxNode *node = GetChildren()->First(); node; node = node->Next() )
+ for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
{
wxWindow *win = (wxWindow *)node->Data();
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
// subwindow found.
void wxFrame::OnActivate(wxActivateEvent& event)
{
- for(wxNode *node = GetChildren()->First(); node; node = node->Next())
+ for(wxNode *node = GetChildren().First(); node; node = node->Next())
{
// Find a child that's a subwindow, but not a dialog box.
wxWindow *child = (wxWindow *)node->Data();
void wxScrollBar::Command(wxCommandEvent& event)
{
- SetPosition(event.m_commandInt);
+ SetThumbPosition(event.m_commandInt);
ProcessCommand(event);
}
SetName(name);
if (parent) parent->AddChild(this);
- SetBackgroundColour(parent->GetDefaultBackgroundColour()) ;
- SetForegroundColour(parent->GetDefaultForegroundColour()) ;
+ SetBackgroundColour(parent->GetBackgroundColour()) ;
+ SetForegroundColour(parent->GetForegroundColour()) ;
if ( id == -1 )
m_windowId = (int)NewControlId();
m_windowStyle = style;
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
// TODO
return FALSE;
// Responds to colour changes: passes event on to children.
void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
// Only propagate to non-top-level windows
// it's an application error (pops up a dialog)
bool wxWindow::TransferDataToWindow()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
// validation failed: don't quit
bool wxWindow::TransferDataFromWindow()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
bool wxWindow::Validate()
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
void wxWindow::AddChild(wxWindow *child)
{
- GetChildren()->Append(child);
+ GetChildren().Append(child);
child->m_windowParent = this;
}
void wxWindow::RemoveChild(wxWindow *child)
{
- if (GetChildren())
- GetChildren()->DeleteObject(child);
+ GetChildren().DeleteObject(child);
child->m_windowParent = NULL;
}
void wxWindow::DestroyChildren()
{
- if (GetChildren()) {
wxNode *node;
- while ((node = GetChildren()->First()) != (wxNode *)NULL) {
+ while ((node = GetChildren().First()) != (wxNode *)NULL) {
wxWindow *child;
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) {
delete child;
- if ( GetChildren()->Member(child) )
+ if ( GetChildren().Member(child) )
delete node;
}
} /* while */
- }
}
void wxWindow::MakeModal(bool modal)
{
noChanges = 0;
noFailures = 0;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *child = (wxWindow *)node->Data();
constr->centreX.SetDone(FALSE);
constr->centreY.SetDone(FALSE);
}
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
if (recurse)
{
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
wxObject* wxWindow::GetChild(int number) const
{
// Return a pointer to the Nth object in the window
- if (!GetChildren())
- return(NULL) ;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
int n = number;
while (node && n--)
node = node->Next() ;
{
int maxX = 0;
int maxY = 0;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *win = (wxWindow *)node->Data();
if ( GetId() == id)
return this;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
if ( GetName() == name)
return this;
- wxNode *node = GetChildren()->First();
+ wxNode *node = GetChildren().First();
while ( node )
{
wxWindow *child = (wxWindow *)node->Data();
wxShapeRegion *region = (wxShapeRegion *)node->Data();
region->SetText(s);
- dc.SetFont(region->GetFont());
+ dc.SetFont(* region->GetFont());
region->GetSize(&w, &h);
GetBoundingBoxMin(&bound_x, &bound_y);
if (m_regions.Number() < 1) return;
- if (m_pen) dc.SetPen(m_pen);
+ if (m_pen) dc.SetPen(* m_pen);
wxShapeRegion *region = (wxShapeRegion *)m_regions.First()->Data();
- if (region->GetFont()) dc.SetFont(region->GetFont());
+ if (region->GetFont()) dc.SetFont(* region->GetFont());
dc.SetTextForeground(* (region->GetActualColourObject()));
dc.SetBackgroundMode(wxTRANSPARENT);
if (m_pen)
penWidth = m_pen->GetWidth();
- dc.SetPen(g_oglWhiteBackgroundPen);
- dc.SetBrush(g_oglWhiteBackgroundBrush);
+ dc.SetPen(* g_oglWhiteBackgroundPen);
+ dc.SetBrush(* g_oglWhiteBackgroundBrush);
dc.DrawRectangle(WXROUND(topLeftX - penWidth), WXROUND(topLeftY - penWidth),
WXROUND(maxX + penWidth*2.0 + 4.0), WXROUND(maxY + penWidth*2.0 + 4.0));
}
if (!m_drawHandles)
return;
- dc.SetBrush(wxBLACK_BRUSH);
- dc.SetPen(wxBLACK_PEN);
+ dc.SetBrush(* wxBLACK_BRUSH);
+ dc.SetPen(* wxBLACK_PEN);
wxNode *node = m_controlPoints.First();
while (node)
if (m_shadowMode != SHADOW_NONE)
{
if (m_shadowBrush)
- dc.SetBrush(m_shadowBrush);
- dc.SetPen(g_oglTransparentPen);
+ dc.SetBrush(* m_shadowBrush);
+ dc.SetPen(* g_oglTransparentPen);
dc.DrawPolygon(n, intPoints, WXROUND(m_xpos + m_shadowOffsetX), WXROUND(m_ypos + m_shadowOffsetY));
}
if (m_pen)
{
if (m_pen->GetWidth() == 0)
- dc.SetPen(g_oglTransparentPen);
+ dc.SetPen(* g_oglTransparentPen);
else
- dc.SetPen(m_pen);
+ dc.SetPen(* m_pen);
}
if (m_brush)
- dc.SetBrush(m_brush);
+ dc.SetBrush(* m_brush);
dc.DrawPolygon(n, intPoints, WXROUND(m_xpos), WXROUND(m_ypos));
delete[] intPoints;
void wxPolygonShape::OnDrawOutline(wxDC& dc, double x, double y, double w, double h)
{
- dc.SetBrush(wxTRANSPARENT_BRUSH);
+ dc.SetBrush(* wxTRANSPARENT_BRUSH);
// Multiply all points by proportion of new size to old size
double x_proportion = (double)(fabs(w/m_originalWidth));
double y_proportion = (double)(fabs(h/m_originalHeight));
if (m_shadowMode != SHADOW_NONE)
{
if (m_shadowBrush)
- dc.SetBrush(m_shadowBrush);
- dc.SetPen(g_oglTransparentPen);
+ dc.SetBrush(* m_shadowBrush);
+ dc.SetPen(* g_oglTransparentPen);
if (m_cornerRadius != 0.0)
dc.DrawRoundedRectangle(WXROUND(x1 + m_shadowOffsetX), WXROUND(y1 + m_shadowOffsetY),
if (m_pen)
{
if (m_pen->GetWidth() == 0)
- dc.SetPen(g_oglTransparentPen);
+ dc.SetPen(* g_oglTransparentPen);
else
- dc.SetPen(m_pen);
+ dc.SetPen(* m_pen);
}
if (m_brush)
- dc.SetBrush(m_brush);
+ dc.SetBrush(* m_brush);
if (m_cornerRadius != 0.0)
dc.DrawRoundedRectangle(WXROUND(x1), WXROUND(y1), WXROUND(m_width), WXROUND(m_height), m_cornerRadius);
if (m_shadowMode != SHADOW_NONE)
{
if (m_shadowBrush)
- dc.SetBrush(m_shadowBrush);
- dc.SetPen(g_oglTransparentPen);
+ dc.SetBrush(* m_shadowBrush);
+ dc.SetPen(* g_oglTransparentPen);
dc.DrawEllipse((long) ((m_xpos - GetWidth()/2) + m_shadowOffsetX),
(long) ((m_ypos - GetHeight()/2) + m_shadowOffsetY),
(long) GetWidth(), (long) GetHeight());
if (m_pen)
{
if (m_pen->GetWidth() == 0)
- dc.SetPen(g_oglTransparentPen);
+ dc.SetPen(* g_oglTransparentPen);
else
- dc.SetPen(m_pen);
+ dc.SetPen(* m_pen);
}
if (m_brush)
- dc.SetBrush(m_brush);
+ dc.SetBrush(* m_brush);
dc.DrawEllipse((long) (m_xpos - GetWidth()/2), (long) (m_ypos - GetHeight()/2), (long) GetWidth(), (long) GetHeight());
}
if (m_shadowMode != SHADOW_NONE)
{
if (m_shadowBrush)
- dc.SetBrush(m_shadowBrush);
- dc.SetPen(g_oglTransparentPen);
+ dc.SetBrush(* m_shadowBrush);
+ dc.SetPen(* g_oglTransparentPen);
if (m_cornerRadius != 0.0)
dc.DrawRoundedRectangle(WXROUND(x1 + m_shadowOffsetX), WXROUND(y1 + m_shadowOffsetY),
void wxDivisionShape::OnDraw(wxDC& dc)
{
- dc.SetBrush(wxTRANSPARENT_BRUSH);
+ dc.SetBrush(* wxTRANSPARENT_BRUSH);
dc.SetBackgroundMode(wxTRANSPARENT);
double x1 = (double)(GetX() - (GetWidth()/2.0));
if (m_leftSide)
{
- dc.SetPen(m_leftSidePen);
+ dc.SetPen(* m_leftSidePen);
dc.DrawLine(WXROUND(x1), WXROUND(y2), WXROUND(x1), WXROUND(y1));
}
if (m_topSide)
{
- dc.SetPen(m_topSidePen);
+ dc.SetPen(* m_topSidePen);
dc.DrawLine(WXROUND(x1), WXROUND(y1), WXROUND(x2), WXROUND(y1));
}
// For testing purposes, draw a rectangle so we know
// how big the division is.
-// SetBrush(wxCYAN_BRUSH);
+// SetBrush(* wxCYAN_BRUSH);
// wxRectangleShape::OnDraw(dc);
}
double leftX = (double)(m_xpos - (m_width / 2.0));
double rightX = (double)(m_xpos + (m_width / 2.0));
- if (m_pen) dc.SetPen(m_pen);
+ if (m_pen) dc.SetPen(* m_pen);
if (m_textColour) dc.SetTextForeground(* m_textColour);
while (node)
{
wxShapeRegion *region = (wxShapeRegion *)node->Data();
- dc.SetFont(region->GetFont());
+ dc.SetFont(* region->GetFont());
dc.SetTextForeground(* region->GetActualColourObject());
double proportion =
wxPen *regionPen = region->GetActualPen();
if (regionPen)
{
- dc.SetPen(regionPen);
+ dc.SetPen(* regionPen);
dc.DrawLine(WXROUND(leftX), WXROUND(y), WXROUND(rightX), WXROUND(y));
}
}
if (m_image->m_outlineColours.Member((wxObject *)m_gdiIndex))
{
if (m_image->m_outlinePen)
- dc.SetPen(m_image->m_outlinePen);
+ dc.SetPen(* m_image->m_outlinePen);
}
else
{
{
wxPen *pen = (wxPen *)node->Data();
if (pen)
- dc.SetPen(pen);
+ dc.SetPen(* pen);
}
}
break;
{
wxBrush *br = wxTheBrushList->FindOrCreateBrush(m_image->m_outlinePen->GetColour(), wxSOLID);
if (br)
- dc.SetBrush(br);
+ dc.SetBrush(* br);
}
}
else if (m_image->m_fillColours.Member((wxObject *)m_gdiIndex))
{
if (m_image->m_fillBrush)
{
- dc.SetBrush(m_image->m_fillBrush);
+ dc.SetBrush(* m_image->m_fillBrush);
}
}
else
{
wxBrush *brush = (wxBrush *)node->Data();
if (brush)
- dc.SetBrush(brush);
+ dc.SetBrush(* brush);
}
}
break;
{
wxFont *font = (wxFont *)node->Data();
if (font)
- dc.SetFont(font);
+ dc.SetFont(* font);
}
break;
}
// Draw an outline using the current operation.
bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double h, double oldW, double oldH)
{
- dc.SetBrush(wxTRANSPARENT_BRUSH);
+ dc.SetBrush(* wxTRANSPARENT_BRUSH);
// Multiply all points by proportion of new size to old size
double x_proportion = (double)(fabs(w/oldW));
wxShapeRegion *region = (wxShapeRegion *)node->Data();
region->SetText(s);
- dc.SetFont(region->GetFont());
+ dc.SetFont(* region->GetFont());
region->GetSize(&w, &h);
// Initialize the size if zero
// First, clear a rectangle for the text IF there is any
if (region->GetFormattedText().Number() > 0)
{
- dc.SetPen(g_oglWhiteBackgroundPen);
- dc.SetBrush(g_oglWhiteBackgroundBrush);
+ dc.SetPen(* g_oglWhiteBackgroundPen);
+ dc.SetBrush(* g_oglWhiteBackgroundBrush);
// Now draw the text
- if (region->GetFont()) dc.SetFont(region->GetFont());
+ if (region->GetFont()) dc.SetFont(* region->GetFont());
dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h);
- if (m_pen) dc.SetPen(m_pen);
+ if (m_pen) dc.SetPen(* m_pen);
dc.SetTextForeground(* region->GetActualColourObject());
#ifdef __WXMSW__
if (region->GetFormattedText().Number() > 0)
{
- dc.SetPen(g_oglWhiteBackgroundPen);
- dc.SetBrush(g_oglWhiteBackgroundBrush);
+ dc.SetPen(* g_oglWhiteBackgroundPen);
+ dc.SetBrush(* g_oglWhiteBackgroundBrush);
dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h);
}
points[2].x = (int) side2_x; points[2].y = (int) side2_y;
points[3].x = (int) tip_x; points[3].y = (int) tip_y;
- dc.SetPen(m_pen);
- dc.SetBrush(m_brush);
+ dc.SetPen(* m_pen);
+ dc.SetBrush(* m_brush);
dc.DrawPolygon(4, points);
break;
}
double x1 = (double)(x - (diameter/2.0));
double y1 = (double)(y - (diameter/2.0));
- dc.SetPen(m_pen);
+ dc.SetPen(* m_pen);
if (arrow->_GetType() == ARROW_HOLLOW_CIRCLE)
- dc.SetBrush(g_oglWhiteBackgroundBrush);
+ dc.SetBrush(* g_oglWhiteBackgroundBrush);
else
- dc.SetBrush(m_brush);
+ dc.SetBrush(* m_brush);
dc.DrawEllipse((long) x1, (long) y1, (long) diameter, (long) diameter);
break;
double bound_x, bound_y;
GetBoundingBoxMax(&bound_x, &bound_y);
- if (m_font) dc.SetFont(m_font);
+ if (m_font) dc.SetFont(* m_font);
// Undraw text regions
for (int i = 0; i < 3; i++)
}
// Undraw line
- dc.SetPen(g_oglWhiteBackgroundPen);
- dc.SetBrush(g_oglWhiteBackgroundBrush);
+ dc.SetPen(* g_oglWhiteBackgroundPen);
+ dc.SetBrush(* g_oglWhiteBackgroundBrush);
// Drawing over the line only seems to work if the line has a thickness
// of 1.
if (m_lineControlPoints)
{
if (m_pen)
- dc.SetPen(m_pen);
+ dc.SetPen(* m_pen);
if (m_brush)
- dc.SetBrush(m_brush);
+ dc.SetBrush(* m_brush);
int n = m_lineControlPoints->Number();
wxPoint *points = new wxPoint[n];
wxPen *solid_pen =
wxThePenList->FindOrCreatePen(m_pen->GetColour(), 1, wxSOLID);
if (solid_pen)
- dc.SetPen(solid_pen);
+ dc.SetPen(* solid_pen);
}
DrawArrows(dc);
}
if (lpt->m_type == CONTROL_POINT_ENDPOINT_FROM || lpt->m_type == CONTROL_POINT_ENDPOINT_TO)
{
- m_canvas->SetCursor(g_oglBullseyeCursor);
+ m_canvas->SetCursor(* g_oglBullseyeCursor);
lpt->m_oldCursor = wxSTANDARD_CURSOR;
}
}
if (lpt->m_type == CONTROL_POINT_ENDPOINT_FROM)
{
if (lpt->m_oldCursor)
- m_canvas->SetCursor(lpt->m_oldCursor);
+ m_canvas->SetCursor(* lpt->m_oldCursor);
// this->Erase(dc);
if (lpt->m_type == CONTROL_POINT_ENDPOINT_TO)
{
if (lpt->m_oldCursor)
- m_canvas->SetCursor(lpt->m_oldCursor);
+ m_canvas->SetCursor(* lpt->m_oldCursor);
// lpt->m_xpos = x; lpt->m_ypos = y;
if (m_pen)
{
if (m_pen->GetWidth() == 0)
- dc.SetPen(g_oglTransparentPen);
+ dc.SetPen(* g_oglTransparentPen);
else
- dc.SetPen(m_pen);
+ dc.SetPen(* m_pen);
}
- dc.SetBrush(wxTRANSPARENT_BRUSH);
+ dc.SetBrush(* wxTRANSPARENT_BRUSH);
if (m_cornerRadius > 0.0)
dc.DrawRoundedRectangle(WXROUND(x1), WXROUND(y1), WXROUND(m_width), WXROUND(m_height), m_cornerRadius);
if (m_shapeList)
{
if (GetCanvas())
- GetCanvas()->SetCursor(wxHOURGLASS_CURSOR);
+ GetCanvas()->SetCursor(* wxHOURGLASS_CURSOR);
wxNode *current = m_shapeList->First();
while (current)
current = current->Next();
}
if (GetCanvas())
- GetCanvas()->SetCursor(wxSTANDARD_CURSOR);
+ GetCanvas()->SetCursor(* wxSTANDARD_CURSOR);
}
}