Initial revision
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
100
include/wx/generic/choicdgg.h
Normal file
100
include/wx/generic/choicdgg.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: choicdgg.h
|
||||
// Purpose: Generic choice dialogs
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CHOICEDLGH_G__
|
||||
#define __CHOICEDLGH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "choicdgg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
#define wxCHOICE_HEIGHT 150
|
||||
#define wxCHOICE_WIDTH 200
|
||||
|
||||
#define wxID_LISTBOX 3000
|
||||
|
||||
class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
|
||||
public:
|
||||
wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
const int n, const wxString *choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
const int n, const wxString *choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
|
||||
const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline int GetSelection(void) const { return m_selection; }
|
||||
inline wxString GetStringSelection(void) const { return m_stringSelection; }
|
||||
inline char *GetSelectionClientData(void) const { return m_clientData; }
|
||||
|
||||
void OnOK(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
long m_dialogStyle;
|
||||
int m_selection;
|
||||
wxString m_stringSelection;
|
||||
char* m_clientData;
|
||||
};
|
||||
|
||||
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
|
||||
const int n, const wxString *choices, wxWindow *parent = NULL,
|
||||
const int x = -1, const int y = -1, const bool centre = TRUE,
|
||||
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
|
||||
|
||||
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
|
||||
const int n, char *choices[], wxWindow *parent = NULL,
|
||||
const int x = -1, const int y = -1, const bool centre = TRUE,
|
||||
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
|
||||
|
||||
// Same as above but gets position in list of strings, instead of string,
|
||||
// or -1 if no selection
|
||||
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
||||
const int n, const wxString *choices, wxWindow *parent = NULL,
|
||||
const int x = -1, const int y = -1, const bool centre = TRUE,
|
||||
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
|
||||
|
||||
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
||||
const int n, char *choices[], wxWindow *parent = NULL,
|
||||
const int x = -1, const int y = -1, const bool centre = TRUE,
|
||||
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
|
||||
|
||||
// Return client data instead
|
||||
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
||||
const int n, const wxString *choices, char **client_data,
|
||||
wxWindow *parent = NULL, const int x = -1, const int y = -1,
|
||||
const bool centre = TRUE,
|
||||
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
|
||||
|
||||
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
||||
const int n, char *choices[], char **client_data,
|
||||
wxWindow *parent = NULL, const int x = -1, const int y = -1,
|
||||
const bool centre = TRUE,
|
||||
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
|
||||
|
||||
/*
|
||||
int WXDLLEXPORT wxGetMultipleChoice(const wxString& message, const wxString& caption,
|
||||
const int n, const wxString *choices,
|
||||
const int nsel, int * selection,
|
||||
wxWindow *parent = NULL, const int x = -1 , const int y = -1, const bool centre = TRUE,
|
||||
const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT);
|
||||
*/
|
||||
|
||||
#endif
|
121
include/wx/generic/colrdlgg.h
Normal file
121
include/wx/generic/colrdlgg.h
Normal file
@@ -0,0 +1,121 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colrdlgg.h
|
||||
// Purpose: wxGenericColourDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __COLORDLGH_G__
|
||||
#define __COLORDLGH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "colrdlgg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
#define wxID_ADD_CUSTOM 3000
|
||||
#define wxID_RED_SLIDER 3001
|
||||
#define wxID_GREEN_SLIDER 3002
|
||||
#define wxID_BLUE_SLIDER 3003
|
||||
|
||||
class WXDLLEXPORT wxSlider;
|
||||
class WXDLLEXPORT wxGenericColourDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
|
||||
protected:
|
||||
wxColourData colourData;
|
||||
wxWindow *dialogParent;
|
||||
|
||||
// Area reserved for grids of colours
|
||||
wxRectangle standardColoursRect;
|
||||
wxRectangle customColoursRect;
|
||||
wxRectangle singleCustomColourRect;
|
||||
|
||||
// Size of each colour rectangle
|
||||
wxIntPoint smallRectangleSize;
|
||||
|
||||
// For single customizable colour
|
||||
wxIntPoint customRectangleSize;
|
||||
|
||||
// Grid spacing (between rectangles)
|
||||
int gridSpacing;
|
||||
|
||||
// Section spacing (between left and right halves of dialog box)
|
||||
int sectionSpacing;
|
||||
|
||||
// 48 'standard' colours
|
||||
wxColour standardColours[48];
|
||||
|
||||
// 16 'custom' colours
|
||||
wxColour customColours[16];
|
||||
|
||||
// One single custom colour (use sliders)
|
||||
wxColour singleCustomColour;
|
||||
|
||||
// Which colour is selected? An index into one of the two areas.
|
||||
int colourSelection;
|
||||
int whichKind; // 1 for standard colours, 2 for custom colours,
|
||||
|
||||
wxSlider *redSlider;
|
||||
wxSlider *greenSlider;
|
||||
wxSlider *blueSlider;
|
||||
|
||||
int buttonY;
|
||||
|
||||
int okButtonX;
|
||||
int customButtonX;
|
||||
|
||||
// static bool colourDialogCancelled;
|
||||
public:
|
||||
wxGenericColourDialog(void);
|
||||
wxGenericColourDialog(wxWindow *parent, wxColourData *data = NULL);
|
||||
~wxGenericColourDialog(void);
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
int ShowModal(void);
|
||||
wxColourData GetColourData(void) { return colourData; }
|
||||
|
||||
// Internal functions
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
bool OnClose(void);
|
||||
|
||||
virtual void CalculateMeasurements(void);
|
||||
virtual void CreateWidgets(void);
|
||||
virtual void InitializeColours(void);
|
||||
|
||||
virtual void PaintBasicColours(wxDC& dc);
|
||||
virtual void PaintCustomColours(wxDC& dc);
|
||||
virtual void PaintCustomColour(wxDC& dc);
|
||||
virtual void PaintHighlight(wxDC& dc, bool draw);
|
||||
|
||||
virtual void OnBasicColourClick(int which);
|
||||
virtual void OnCustomColourClick(int which);
|
||||
|
||||
/*
|
||||
virtual void OnOk(void);
|
||||
virtual void OnCancel(void);
|
||||
virtual void OnAddCustom(void);
|
||||
*/
|
||||
void OnAddCustom(wxCommandEvent& event);
|
||||
|
||||
void OnRedSlider(wxCommandEvent& event);
|
||||
void OnGreenSlider(wxCommandEvent& event);
|
||||
void OnBlueSlider(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
typedef wxGenericColourDialog wxColourDialog;
|
||||
|
||||
#endif
|
94
include/wx/generic/fontdlgg.h
Normal file
94
include/wx/generic/fontdlgg.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fontdlgg.h
|
||||
// Purpose: wxGenericFontDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __FONTDLGH_G__
|
||||
#define __FONTDLGH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "fontdlgg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* FONT DIALOG
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxChoice;
|
||||
class WXDLLEXPORT wxText;
|
||||
class WXDLLEXPORT wxCheckBox;
|
||||
|
||||
#define wxID_FONT_UNDERLINE 3000
|
||||
#define wxID_FONT_STYLE 3001
|
||||
#define wxID_FONT_WEIGHT 3002
|
||||
#define wxID_FONT_FAMILY 3003
|
||||
#define wxID_FONT_COLOUR 3004
|
||||
#define wxID_FONT_SIZE 3005
|
||||
|
||||
class WXDLLEXPORT wxGenericFontDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
|
||||
protected:
|
||||
wxFontData fontData;
|
||||
wxFont dialogFont;
|
||||
wxWindow *dialogParent;
|
||||
|
||||
// Area reserved for font display
|
||||
wxRectangle fontRect;
|
||||
|
||||
wxChoice *familyChoice;
|
||||
wxChoice *styleChoice;
|
||||
wxChoice *weightChoice;
|
||||
wxChoice *colourChoice;
|
||||
wxCheckBox *underLineCheckBox;
|
||||
wxChoice *pointSizeChoice;
|
||||
|
||||
// static bool fontDialogCancelled;
|
||||
public:
|
||||
|
||||
wxGenericFontDialog(void);
|
||||
wxGenericFontDialog(wxWindow *parent, wxFontData *data = NULL);
|
||||
~wxGenericFontDialog(void);
|
||||
|
||||
bool Create(wxWindow *parent, wxFontData *data = NULL);
|
||||
|
||||
int ShowModal(void);
|
||||
|
||||
inline wxFontData& GetFontData(void) { return fontData; }
|
||||
|
||||
// Internal functions
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
bool OnClose(void);
|
||||
|
||||
virtual void CreateWidgets(void);
|
||||
virtual void InitializeFont(void);
|
||||
|
||||
virtual void PaintFontBackground(wxDC& dc);
|
||||
virtual void PaintFont(wxDC& dc);
|
||||
|
||||
void OnChangeFont(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
char* WXDLLEXPORT wxFontFamilyIntToString(int family);
|
||||
char* WXDLLEXPORT wxFontWeightIntToString(int weight);
|
||||
char* WXDLLEXPORT wxFontStyleIntToString(int style);
|
||||
int WXDLLEXPORT wxFontFamilyStringToInt(char *family);
|
||||
int WXDLLEXPORT wxFontWeightStringToInt(char *weight);
|
||||
int WXDLLEXPORT wxFontStyleStringToInt(char *style);
|
||||
|
||||
#endif
|
319
include/wx/generic/gridg.h
Normal file
319
include/wx/generic/gridg.h
Normal file
@@ -0,0 +1,319 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gridg.h
|
||||
// Purpose: wxGenericGrid
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GRIDH_G__
|
||||
#define __GRIDH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "gridg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/scrolbar.h"
|
||||
|
||||
#define wxGRID_DEFAULT_EDIT_WIDTH 300
|
||||
#define wxGRID_DEFAULT_EDIT_HEIGHT 27
|
||||
#define wxGRID_DEFAULT_EDIT_X 5
|
||||
#define wxGRID_DEFAULT_EDIT_Y 1
|
||||
#define wxGRID_DEFAULT_SHEET_TOP 31
|
||||
#define wxGRID_DEFAULT_SHEET_LEFT 0
|
||||
#define wxGRID_DEFAULT_CELL_HEIGHT 20
|
||||
#define wxGRID_DEFAULT_CELL_WIDTH 80
|
||||
#define wxGRID_DEFAULT_VERTICAL_LABEL_WIDTH 40
|
||||
#define wxGRID_DEFAULT_HORIZONAL_LABEL_HEIGHT 20
|
||||
|
||||
#ifndef wxLEFT
|
||||
#define wxLEFT 0x0400
|
||||
#endif
|
||||
|
||||
#ifndef wxRIGHT
|
||||
#define wxRIGHT 0x0800
|
||||
#endif
|
||||
|
||||
#define WXGENERIC_GRID_VERSION 0.4
|
||||
|
||||
class WXDLLEXPORT wxGridCell;
|
||||
class WXDLLEXPORT wxGenericGrid: public wxPanel
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericGrid)
|
||||
protected:
|
||||
wxTextCtrl *textItem;
|
||||
wxScrollBar *hScrollBar;
|
||||
wxScrollBar *vScrollBar;
|
||||
int wCursorRow;
|
||||
int wCursorColumn;
|
||||
wxRectangle CurrentRect;
|
||||
bool currentRectVisible;
|
||||
wxGridCell ***gridCells;
|
||||
wxGridCell **rowLabelCells;
|
||||
wxGridCell **colLabelCells;
|
||||
bool bEditCreated;
|
||||
bool editable;
|
||||
|
||||
int totalRows;
|
||||
int totalCols;
|
||||
|
||||
// Row and column we're currently looking at
|
||||
int scrollPosX;
|
||||
int scrollPosY;
|
||||
|
||||
// Dimensions
|
||||
int leftOfSheet;
|
||||
int topOfSheet;
|
||||
int rightOfSheet; // Calculated from colWidths
|
||||
int bottomOfSheet; // Calculated from rowHeights
|
||||
int totalGridWidth; // Total 'virtual' size
|
||||
int totalGridHeight;
|
||||
int cellHeight; // For now, a default
|
||||
int verticalLabelWidth;
|
||||
int horizontalLabelHeight;
|
||||
int verticalLabelAlignment;
|
||||
int horizontalLabelAlignment;
|
||||
int cellAlignment;
|
||||
short *colWidths; // Dynamically allocated
|
||||
short *rowHeights; // Dynamically allocated
|
||||
int scrollWidth; // Vert. scroll width, horiz. scroll height
|
||||
|
||||
// Colours
|
||||
wxColour cellTextColour;
|
||||
wxColour cellBackgroundColour;
|
||||
wxFont *cellTextFont;
|
||||
wxColour labelTextColour;
|
||||
wxColour labelBackgroundColour;
|
||||
wxBrush *labelBackgroundBrush;
|
||||
wxFont *labelTextFont;
|
||||
wxPen *divisionPen;
|
||||
|
||||
// Position of Edit control
|
||||
wxRectangle editControlPosition;
|
||||
|
||||
// Drag status
|
||||
int dragStatus;
|
||||
int dragRowOrCol;
|
||||
int dragStartPosition;
|
||||
int dragLastPosition;
|
||||
static wxCursor *horizontalSashCursor;
|
||||
static wxCursor *verticalSashCursor;
|
||||
|
||||
// Don't refresh whilst this is > 0
|
||||
int batchCount;
|
||||
|
||||
public:
|
||||
wxGenericGrid(void);
|
||||
|
||||
inline wxGenericGrid(wxWindow *parent, int x, int y, int width, int height, const long style = 0, char *name = "grid")
|
||||
{
|
||||
Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
|
||||
}
|
||||
inline wxGenericGrid(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, const long style = 0, const wxString& name = "grid")
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
~wxGenericGrid(void);
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID, const wxPoint& pos, const wxSize& size, const long style = 0, const wxString& name = "grid");
|
||||
|
||||
bool CreateGrid(int nRows, int nCols, wxString **cellValues = NULL, short *widths = NULL,
|
||||
short defaultWidth = wxGRID_DEFAULT_CELL_WIDTH, short defaultHeight = wxGRID_DEFAULT_CELL_HEIGHT);
|
||||
void ClearGrid(void);
|
||||
virtual wxGridCell *GetCell(int row, int col);
|
||||
inline wxGridCell ***GetCells(void) { return 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);
|
||||
bool AppendRows(int n = 1, bool updateLabels = TRUE);
|
||||
bool DeleteCols(int pos = 0, int n = 1, bool updateLabels = TRUE);
|
||||
bool DeleteRows(int pos = 0, int n = 1, bool updateLabels = TRUE);
|
||||
|
||||
// Cell accessors
|
||||
void SetCellValue(const wxString& val, int row, int col);
|
||||
wxString& GetCellValue(int row, int col);
|
||||
void SetCellAlignment(int flag, int row, int col);
|
||||
void SetCellAlignment(int flag);
|
||||
int GetCellAlignment(int row, int col);
|
||||
int GetCellAlignment(void);
|
||||
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 cellTextColour; }
|
||||
void SetCellBackgroundColour(const wxColour& col);
|
||||
void SetCellBackgroundColour(const wxColour& colour, int row, int col);
|
||||
inline wxColour& GetCellBackgroundColour(void) { return cellBackgroundColour; }
|
||||
wxColour& GetCellBackgroundColour(int row, int col);
|
||||
inline wxFont *GetCellTextFont(void) { return 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);
|
||||
void SetCellBitmap(wxBitmap *bitmap, int row, int col);
|
||||
|
||||
// Size accessors
|
||||
void SetColumnWidth(int col, int width);
|
||||
int GetColumnWidth(int col);
|
||||
void SetRowHeight(int row, int height);
|
||||
int GetRowHeight(int row);
|
||||
|
||||
// Label accessors
|
||||
void SetLabelSize(int orientation, int sz);
|
||||
int GetLabelSize(int orientation);
|
||||
void SetLabelAlignment(int orientation, int alignment);
|
||||
int GetLabelAlignment(int orientation);
|
||||
wxGridCell *GetLabelCell(int orientation, int pos);
|
||||
void SetLabelValue(int orientation, const wxString& val, int pos);
|
||||
wxString& GetLabelValue(int orientation, int pos);
|
||||
void SetLabelTextColour(const wxColour& colour);
|
||||
void SetLabelBackgroundColour(const wxColour& colour);
|
||||
inline wxColour& GetLabelTextColour(void) { return labelTextColour; }
|
||||
inline wxColour& GetLabelBackgroundColour(void) { return labelBackgroundColour; }
|
||||
inline wxFont *GetLabelTextFont(void) { return labelTextFont; }
|
||||
inline void SetLabelTextFont(wxFont *fnt) { labelTextFont = fnt; }
|
||||
|
||||
// Miscellaneous accessors
|
||||
inline int GetCursorRow(void) { return wCursorRow; }
|
||||
inline int GetCursorColumn(void) { return wCursorColumn; }
|
||||
void SetGridCursor(int row, int col);
|
||||
inline int GetRows(void) { return totalRows; }
|
||||
inline int GetCols(void) { return totalCols; }
|
||||
inline int GetScrollPosX(void) { return scrollPosX; }
|
||||
inline int GetScrollPosY(void) { return scrollPosY; }
|
||||
inline void SetScrollPosX(int pos) { scrollPosX = pos; }
|
||||
inline void SetScrollPosY(int pos) { scrollPosY = pos; }
|
||||
inline wxTextCtrl *GetTextItem(void) { return textItem; }
|
||||
inline wxScrollBar *GetHorizScrollBar(void) { return hScrollBar; }
|
||||
inline wxScrollBar *GetVertScrollBar(void) { return vScrollBar; }
|
||||
inline bool GetEditable(void) { return editable; }
|
||||
void SetEditable(bool edit);
|
||||
inline wxRectangle& GetCurrentRect(void) { return CurrentRect; }
|
||||
inline bool CurrentCellVisible(void) { return currentRectVisible; }
|
||||
inline void SetDividerPen(wxPen *pen) { divisionPen = pen; }
|
||||
inline wxPen *GetDividerPen(void) { return divisionPen; }
|
||||
|
||||
// High-level event handling
|
||||
// Override e.g. to check value of current cell; but call
|
||||
// base member for default processing.
|
||||
virtual void OnSelectCellImplementation(wxDC *dc, int row, int col);
|
||||
|
||||
virtual void OnSelectCell(int WXUNUSED(row), int WXUNUSED(col)) {};
|
||||
|
||||
// Override to create your own class of grid cell
|
||||
virtual wxGridCell *OnCreateCell(void);
|
||||
|
||||
// Override to change labels e.g. creation of grid, inserting/deleting a row/col.
|
||||
// By default, auto-labels the grid.
|
||||
virtual void OnChangeLabels(void);
|
||||
|
||||
// Override to change the label of the edit field when selecting a cell
|
||||
// By default, sets it to e.g. A12
|
||||
virtual void OnChangeSelectionLabel(void);
|
||||
|
||||
// Override for event processing
|
||||
virtual void OnCellChange(int WXUNUSED(row), int WXUNUSED(col)) {};
|
||||
virtual void OnCellLeftClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
|
||||
virtual void OnCellRightClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
|
||||
virtual void OnLabelLeftClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
|
||||
virtual void OnLabelRightClick(int WXUNUSED(row), int WXUNUSED(col), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(control), bool WXUNUSED(shift)) {};
|
||||
|
||||
// Activation: call from wxFrame::OnActivate
|
||||
void OnActivate(bool active);
|
||||
|
||||
// Miscellaneous
|
||||
void AdjustScrollbars(void);
|
||||
void UpdateDimensions(void);
|
||||
|
||||
/* INTERNAL
|
||||
*/
|
||||
void SetCurrentRect (int Row, int Column, int canvasW = -1, int canvasH = -1);
|
||||
void HighlightCell (wxDC *dc);
|
||||
void DrawCellText(void);
|
||||
void SetGridClippingRegion(wxDC *dc);
|
||||
virtual bool CellHitTest(int x, int y, int *row, int *col);
|
||||
virtual bool LabelSashHitTest(int x, int y, int *orientation, int *rowOrCol, int *startPos);
|
||||
virtual bool LabelHitTest(int x, int y, int *row, int *col);
|
||||
// Painting
|
||||
virtual void DrawLabelAreas(wxDC *dc);
|
||||
virtual void DrawEditableArea(wxDC *dc);
|
||||
virtual void DrawGridLines(wxDC *dc);
|
||||
virtual void DrawColumnLabels(wxDC *dc);
|
||||
virtual void DrawColumnLabel(wxDC *dc, wxRectangle *rect, int col);
|
||||
virtual void DrawRowLabels(wxDC *dc);
|
||||
virtual void DrawRowLabel(wxDC *dc, wxRectangle *rect, int row);
|
||||
virtual void DrawCells(wxDC *dc);
|
||||
virtual void DrawCellValue(wxDC *dc, wxRectangle *rect, int row, int col);
|
||||
virtual void DrawCellBackground(wxDC *dc, wxRectangle *rect, int row, int col);
|
||||
virtual void DrawTextRect(wxDC *dc, const wxString& text, wxRectangle *rect, int flag);
|
||||
virtual void DrawBitmapRect(wxDC *dc, wxBitmap *bitmap, wxRectangle *rect, int flag);
|
||||
|
||||
// Refresh cell and optionally set the text field
|
||||
void RefreshCell(int row, int col, bool setText = FALSE);
|
||||
|
||||
// Don't refresh within the outer pair of these.
|
||||
inline void BeginBatch(void) { batchCount ++; }
|
||||
inline void EndBatch(void) { batchCount --; }
|
||||
inline int GetBatchCount(void) { return batchCount; }
|
||||
|
||||
void OnText(wxCommandEvent& ev);
|
||||
void OnGridScroll(wxScrollEvent& ev);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#define wxGRID_TEXT_CTRL 2000
|
||||
#define wxGRID_HSCROLL 2001
|
||||
#define wxGRID_VSCROLL 2002
|
||||
|
||||
class WXDLLEXPORT wxGridCell: public wxObject
|
||||
{
|
||||
public:
|
||||
wxString textValue;
|
||||
wxFont *font;
|
||||
wxColour textColour;
|
||||
wxColour backgroundColour;
|
||||
wxBrush *backgroundBrush;
|
||||
wxBitmap *cellBitmap;
|
||||
int alignment;
|
||||
|
||||
wxGridCell(wxGenericGrid *window = NULL);
|
||||
~wxGridCell(void);
|
||||
|
||||
virtual wxString& GetTextValue(void) { return 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 void SetTextColour(const wxColour& colour) { textColour = colour; }
|
||||
inline wxColour& GetBackgroundColour(void) { return backgroundColour; }
|
||||
void SetBackgroundColour(const wxColour& colour);
|
||||
inline wxBrush *GetBackgroundBrush(void) { return backgroundBrush; }
|
||||
inline int GetAlignment(void) { return alignment; }
|
||||
inline void SetAlignment(int align) { alignment = align; }
|
||||
inline wxBitmap *GetCellBitmap(void) { return cellBitmap; }
|
||||
inline void SetCellBitmap(wxBitmap *bitmap) { cellBitmap = bitmap; }
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxGrid: public wxGenericGrid
|
||||
{
|
||||
public:
|
||||
wxGrid(void):wxGenericGrid() {}
|
||||
wxGrid(wxWindow *parent, int x=-1, int y=-1, int width=-1, int height=-1,
|
||||
long style=0, char *name = "gridWindow"):
|
||||
wxGenericGrid(parent, x, y, width, height, style, name)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
127
include/wx/generic/helpxlp.h
Normal file
127
include/wx/generic/helpxlp.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: helpxlp.h
|
||||
// Purpose: Help system: wxHelp implementation
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* sccsid[] = "@(#)wx_help.h 1.2 5/9/94" */
|
||||
|
||||
#ifndef __HELPXLPH__
|
||||
#define __HELPXLPH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "helpxlp.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "wx/wx.h"
|
||||
|
||||
#if USE_HELP
|
||||
|
||||
#include "wx/helpbase.h"
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#include "wx/dde.h"
|
||||
#else
|
||||
// Or whatever it'll be called
|
||||
#include "wx/ipctcp.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxXLPHelpController;
|
||||
|
||||
// Connection class for implementing the connection between the
|
||||
// wxHelp process and the application
|
||||
class WXDLLEXPORT wxXLPHelpConnection: public
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
wxDDEConnection
|
||||
#else
|
||||
wxTCPConnection
|
||||
#endif
|
||||
|
||||
{
|
||||
friend class wxXLPHelpController;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxXLPHelpConnection)
|
||||
|
||||
public:
|
||||
|
||||
wxXLPHelpConnection(wxXLPHelpController *instance);
|
||||
bool OnDisconnect(void);
|
||||
|
||||
private:
|
||||
wxXLPHelpController *helpInstance;
|
||||
};
|
||||
|
||||
// Connection class for implementing the client process
|
||||
// controlling the wxHelp process
|
||||
class WXDLLEXPORT wxXLPHelpClient: public
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
wxDDEClient
|
||||
#else
|
||||
wxTCPClient
|
||||
#endif
|
||||
|
||||
{
|
||||
DECLARE_CLASS(wxXLPHelpClient)
|
||||
|
||||
friend class WXDLLEXPORT wxXLPHelpController;
|
||||
public:
|
||||
wxXLPHelpClient(wxXLPHelpController* c) { m_controller = c; }
|
||||
|
||||
wxConnectionBase *OnMakeConnection(void)
|
||||
{ return new wxXLPHelpConnection(m_controller);
|
||||
}
|
||||
protected:
|
||||
wxXLPHelpController* m_controller;
|
||||
};
|
||||
|
||||
// An application can have one or more instances of wxHelp,
|
||||
// represented by an object of this class.
|
||||
// Nothing happens on initial creation; the application
|
||||
// must call a member function to display help.
|
||||
// If the instance of wxHelp is already active, that instance
|
||||
// will be used for subsequent help.
|
||||
|
||||
class WXDLLEXPORT wxXLPHelpController: public wxHelpControllerBase
|
||||
{
|
||||
friend class WXDLLEXPORT wxXLPHelpConnection;
|
||||
DECLARE_CLASS(wxXLPHelpController)
|
||||
|
||||
public:
|
||||
wxXLPHelpController(void);
|
||||
~wxXLPHelpController(void);
|
||||
|
||||
// Must call this to set the filename and server name
|
||||
virtual bool Initialize(const wxString& file, int server = -1);
|
||||
// If file is "", reloads file given in Initialize
|
||||
virtual bool LoadFile(const wxString& file = "");
|
||||
virtual bool DisplayContents(void);
|
||||
virtual bool DisplaySection(int sectionNo);
|
||||
virtual bool DisplayBlock(long blockNo);
|
||||
virtual bool KeywordSearch(const wxString& k);
|
||||
|
||||
virtual bool Quit(void);
|
||||
virtual void OnQuit(void);
|
||||
|
||||
// Private
|
||||
bool Run(void);
|
||||
|
||||
protected:
|
||||
wxString helpFile;
|
||||
wxString helpHost;
|
||||
int helpServer;
|
||||
bool helpRunning;
|
||||
wxXLPHelpConnection* helpConnection;
|
||||
wxXLPHelpClient helpClient;
|
||||
};
|
||||
|
||||
#endif // USE_HELP
|
||||
#endif
|
||||
// __HELPXLPH__
|
67
include/wx/generic/imaglist.h
Normal file
67
include/wx/generic/imaglist.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imaglist.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Id:
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __IMAGELISTH_G__
|
||||
#define __IMAGELISTH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/dc.h"
|
||||
|
||||
/*
|
||||
* wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
|
||||
* images for their items by an index into an image list.
|
||||
* A wxImageList is capable of creating images with optional masks from
|
||||
* a variety of sources - a single bitmap plus a colour to indicate the mask,
|
||||
* two bitmaps, or an icon.
|
||||
*
|
||||
* Image lists can also create and draw images used for drag and drop functionality.
|
||||
* This is not yet implemented in wxImageList. We need to discuss a generic API
|
||||
* for doing drag and drop and see whether it ties in with the Win95 view of it.
|
||||
* See below for candidate functions and an explanation of how they might be
|
||||
* used.
|
||||
*/
|
||||
|
||||
// Flags for Draw
|
||||
#define wxIMAGELIST_DRAW_NORMAL 0x0001
|
||||
#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
|
||||
#define wxIMAGELIST_DRAW_SELECTED 0x0004
|
||||
#define wxIMAGELIST_DRAW_FOCUSED 0x0008
|
||||
|
||||
class wxImageList: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxImageList)
|
||||
|
||||
public:
|
||||
|
||||
wxImageList(void);
|
||||
~wxImageList(void);
|
||||
bool Create(void);
|
||||
int GetImageCount(void) const;
|
||||
int Add( const wxBitmap &bitmap );
|
||||
bool Replace( const int index, const wxBitmap &bitmap );
|
||||
bool Remove( const int index );
|
||||
bool RemoveAll(void);
|
||||
bool GetSize( const int index, int &width, int &height ) const;
|
||||
bool Draw(const int index, wxDC& dc, const int x, const int y,
|
||||
const int flags = wxIMAGELIST_DRAW_NORMAL, const bool solidBackground = FALSE );
|
||||
|
||||
private:
|
||||
|
||||
wxList m_images;
|
||||
};
|
||||
|
||||
#endif // __IMAGELISTH_G__
|
||||
|
649
include/wx/generic/listctrl.h
Normal file
649
include/wx/generic/listctrl.h
Normal file
@@ -0,0 +1,649 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: listctrl.h
|
||||
// Purpose: Generic list control
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Id:
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __LISTCTRLH_G__
|
||||
#define __LISTCTRLH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/timer.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListItem;
|
||||
class wxListEvent;
|
||||
class wxListCtrl;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// internal classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListHeaderData;
|
||||
class wxListItemData;
|
||||
class wxListLineData;
|
||||
|
||||
class wxListHeaderWindow;
|
||||
class wxListMainWindow;
|
||||
|
||||
class wxListRenameTimer;
|
||||
//class wxListTextCtrl;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// type of compare function for wxListCtrl sort operation
|
||||
typedef int (*wxListCtrlCompare)(const long item1, const long item2, long sortData);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListCtrl flags
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define wxLC_ICON 0x0004
|
||||
#define wxLC_SMALL_ICON 0x0008
|
||||
#define wxLC_LIST 0x0010
|
||||
#define wxLC_REPORT 0x0020
|
||||
#define wxLC_ALIGN_TOP 0x0040
|
||||
#define wxLC_ALIGN_LEFT 0x0080
|
||||
#define wxLC_AUTOARRANGE 0x0100 // not supported in wxGLC
|
||||
#define wxLC_USER_TEXT 0x0200 // not supported in wxGLC (how does it work?)
|
||||
#define wxLC_EDIT_LABELS 0x0400
|
||||
#define wxLC_NO_HEADER 0x0800 // not supported in wxGLC
|
||||
#define wxLC_NO_SORT_HEADER 0x1000 // not supported in wxGLC
|
||||
#define wxLC_SINGLE_SEL 0x2000
|
||||
#define wxLC_SORT_ASCENDING 0x4000
|
||||
#define wxLC_SORT_DESCENDING 0x8000 // not supported in wxGLC
|
||||
|
||||
#define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT)
|
||||
#define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT)
|
||||
#define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING)
|
||||
|
||||
// Omitted because (a) too much detail (b) not enough style flags
|
||||
// #define wxLC_NO_SCROLL
|
||||
// #define wxLC_NO_LABEL_WRAP
|
||||
// #define wxLC_OWNERDRAW_FIXED
|
||||
// #define wxLC_SHOW_SEL_ALWAYS
|
||||
|
||||
// Mask flags to tell app/GUI what fields of wxListItem are valid
|
||||
#define wxLIST_MASK_STATE 0x0001
|
||||
#define wxLIST_MASK_TEXT 0x0002
|
||||
#define wxLIST_MASK_IMAGE 0x0004
|
||||
#define wxLIST_MASK_DATA 0x0008
|
||||
#define wxLIST_SET_ITEM 0x0010
|
||||
#define wxLIST_MASK_WIDTH 0x0020
|
||||
#define wxLIST_MASK_FORMAT 0x0040
|
||||
|
||||
// State flags for indicating the state of an item
|
||||
#define wxLIST_STATE_DONTCARE 0x0000
|
||||
#define wxLIST_STATE_DROPHILITED 0x0001 // not supported in wxGLC
|
||||
#define wxLIST_STATE_FOCUSED 0x0002
|
||||
#define wxLIST_STATE_SELECTED 0x0004
|
||||
#define wxLIST_STATE_CUT 0x0008 // not supported in wxGLC
|
||||
|
||||
// Hit test flags, used in HitTest // wxGLC suppots 20 and 80
|
||||
#define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area.
|
||||
#define wxLIST_HITTEST_BELOW 0x0002 // Below the client area.
|
||||
#define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
|
||||
#define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
|
||||
#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
|
||||
#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
|
||||
#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
|
||||
#define wxLIST_HITTEST_TOLEFT 0x0400 // To the right of the client area.
|
||||
#define wxLIST_HITTEST_TORIGHT 0x0800 // To the left of the client area.
|
||||
|
||||
#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL | wxLIST_HITTEST_ONITEMSTATEICON)
|
||||
|
||||
|
||||
|
||||
// Flags for GetNextItem // always wxLIST_NEXT_ALL in wxGLC
|
||||
enum {
|
||||
wxLIST_NEXT_ABOVE, // Searches for an item above the specified item
|
||||
wxLIST_NEXT_ALL, // Searches for subsequent item by index
|
||||
wxLIST_NEXT_BELOW, // Searches for an item below the specified item
|
||||
wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item
|
||||
wxLIST_NEXT_RIGHT, // Searches for an item to the right of the specified item
|
||||
};
|
||||
|
||||
// Alignment flags for Arrange // always wxLIST_ALIGN_LEFT in wxGLC
|
||||
enum {
|
||||
wxLIST_ALIGN_DEFAULT,
|
||||
wxLIST_ALIGN_LEFT,
|
||||
wxLIST_ALIGN_TOP,
|
||||
wxLIST_ALIGN_SNAP_TO_GRID
|
||||
};
|
||||
|
||||
// Column format // always wxLIST_FORMAT_LEFT in wxGLC
|
||||
enum {
|
||||
wxLIST_FORMAT_LEFT,
|
||||
wxLIST_FORMAT_RIGHT,
|
||||
wxLIST_FORMAT_CENTRE,
|
||||
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
|
||||
};
|
||||
|
||||
// Autosize values for SetColumnWidth
|
||||
enum {
|
||||
wxLIST_AUTOSIZE = -1, // always 80 in wxGLC (what else?)
|
||||
wxLIST_AUTOSIZE_USEHEADER = -2
|
||||
};
|
||||
|
||||
// Flag values for GetItemRect
|
||||
enum {
|
||||
wxLIST_RECT_BOUNDS,
|
||||
wxLIST_RECT_ICON,
|
||||
wxLIST_RECT_LABEL
|
||||
};
|
||||
|
||||
// Flag values for FindItem // not supported by wxGLC
|
||||
enum {
|
||||
wxLIST_FIND_UP,
|
||||
wxLIST_FIND_DOWN,
|
||||
wxLIST_FIND_LEFT,
|
||||
wxLIST_FIND_RIGHT
|
||||
};
|
||||
|
||||
// Flag values for Set/GetImageList
|
||||
enum {
|
||||
wxIMAGE_LIST_NORMAL, // Normal icons
|
||||
wxIMAGE_LIST_SMALL, // Small icons
|
||||
wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
|
||||
// not implemented in wxGLC (see non-existing documentation..)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListItem
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListItem: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListItem)
|
||||
|
||||
public:
|
||||
long m_mask; // Indicates what fields are valid
|
||||
long m_itemId; // The zero-based item position
|
||||
int m_col; // Zero-based column, if in report mode
|
||||
long m_state; // The state of the item
|
||||
long m_stateMask; // Which flags of m_state are valid (uses same flags)
|
||||
wxString m_text; // The label/header text
|
||||
int m_image; // The zero-based index into an image list
|
||||
long m_data; // App-defined data
|
||||
wxColour *m_colour; // only wxGLC, not supported by Windows ;->
|
||||
|
||||
// For columns only
|
||||
int m_format; // left, right, centre
|
||||
int m_width; // width of column
|
||||
|
||||
wxListItem(void);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxListEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListEvent)
|
||||
|
||||
public:
|
||||
wxListEvent(WXTYPE commandType = 0, int id = 0);
|
||||
|
||||
int m_code;
|
||||
long m_itemIndex;
|
||||
long m_oldItemIndex;
|
||||
int m_col;
|
||||
bool m_cancelled;
|
||||
wxPoint m_pointDrag;
|
||||
|
||||
wxListItem m_item;
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
|
||||
|
||||
#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListItemData (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListItemData : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListItemData);
|
||||
|
||||
protected:
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
long m_data;
|
||||
int m_xpos,m_ypos;
|
||||
int m_width,m_height;
|
||||
wxColour *m_colour;
|
||||
|
||||
public:
|
||||
wxListItemData(void);
|
||||
wxListItemData( const wxListItem &info );
|
||||
void SetItem( const wxListItem &info );
|
||||
void SetText( const wxString &s );
|
||||
void SetImage( const int image );
|
||||
void SetData( const long data );
|
||||
void SetPosition( const int x, const int y );
|
||||
void SetSize( const int width, const int height );
|
||||
void SetColour( wxColour *col );
|
||||
bool HasImage(void) const;
|
||||
bool HasText(void) const;
|
||||
bool IsHit( const int x, const int y ) const;
|
||||
void GetText( wxString &s );
|
||||
int GetX( void ) const;
|
||||
int GetY( void ) const;
|
||||
int GetWidth(void) const;
|
||||
int GetHeight(void) const;
|
||||
int GetImage(void) const;
|
||||
void GetItem( wxListItem &info );
|
||||
wxColour *GetColour(void);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListHeaderData (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListHeaderData : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListHeaderData);
|
||||
|
||||
protected:
|
||||
long m_mask;
|
||||
int m_image;
|
||||
wxString m_text;
|
||||
int m_format;
|
||||
int m_width;
|
||||
int m_xpos,m_ypos;
|
||||
int m_height;
|
||||
|
||||
public:
|
||||
wxListHeaderData(void);
|
||||
wxListHeaderData( const wxListItem &info );
|
||||
void SetItem( const wxListItem &item );
|
||||
void SetPosition( const int x, const int y );
|
||||
void SetWidth( const int w );
|
||||
void SetFormat( const int format );
|
||||
void SetHeight( const int h );
|
||||
bool HasImage(void) const;
|
||||
bool HasText(void) const;
|
||||
bool IsHit( const int x, const int y ) const;
|
||||
void GetItem( wxListItem &item );
|
||||
void GetText( wxString &s );
|
||||
int GetImage(void) const;
|
||||
int GetWidth(void) const;
|
||||
int GetFormat(void) const;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListLineData (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListLineData : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListLineData);
|
||||
|
||||
protected:
|
||||
wxList m_items;
|
||||
wxRectangle m_bound_all;
|
||||
wxRectangle m_bound_label;
|
||||
wxRectangle m_bound_icon;
|
||||
wxRectangle m_bound_hilight;
|
||||
int m_mode;
|
||||
bool m_hilighted;
|
||||
wxBrush *m_hilightBrush;
|
||||
int m_spacing;
|
||||
wxListMainWindow *m_owner;
|
||||
|
||||
void DoDraw( wxPaintDC *dc, const bool hilight, const bool paintBG );
|
||||
|
||||
public:
|
||||
wxListLineData( void ) {};
|
||||
wxListLineData( wxListMainWindow *owner, const int mode, wxBrush *hilightBrush );
|
||||
void CalculateSize( wxPaintDC *dc, const int spacing );
|
||||
void SetPosition( wxPaintDC *dc, const int x, const int y, const int window_width );
|
||||
void SetColumnPosition( const int index, const int x );
|
||||
void GetSize( int &width, int &height );
|
||||
void GetExtent( int &x, int &y, int &width, int &height );
|
||||
void GetLabelExtent( int &x, int &y, int &width, int &height );
|
||||
long IsHit( const int x, const int y );
|
||||
void InitItems( const int num );
|
||||
void SetItem( const int index, const wxListItem &info );
|
||||
void GetItem( const int index, wxListItem &info );
|
||||
void GetText( const int index, wxString &s );
|
||||
void SetText( const int index, const wxString s );
|
||||
int GetImage( const int index );
|
||||
void GetRect( wxRectangle &rect );
|
||||
void Hilight( const bool on );
|
||||
void ReverseHilight( void );
|
||||
void DrawRubberBand( wxPaintDC *dc, const bool on );
|
||||
void Draw( wxPaintDC *dc );
|
||||
bool IsInRect( const int x, const int y, const wxRectangle &rect );
|
||||
bool IsHilighted( void );
|
||||
void AssignRect( wxRectangle &dest, const int x, const int y, const int width, const int height );
|
||||
void AssignRect( wxRectangle &dest, const wxRectangle &source );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListHeaderWindow (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListHeaderWindow : public wxWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListHeaderWindow)
|
||||
|
||||
protected:
|
||||
wxListMainWindow *m_owner;
|
||||
wxCursor *m_currentCursor;
|
||||
wxCursor *m_resizeCursor;
|
||||
|
||||
public:
|
||||
wxListHeaderWindow( void );
|
||||
wxListHeaderWindow( wxWindow *win, const wxWindowID id, wxListMainWindow *owner,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
const long style = 0, const wxString &name = "columntitles" );
|
||||
void DoDrawRect( wxPaintDC *dc, int x, int y, int w, int h );
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void OnMouse( wxMouseEvent &event );
|
||||
void OnSetFocus( wxFocusEvent &event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListRenameTimer (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListRenameTimer: public wxTimer
|
||||
{
|
||||
private:
|
||||
wxListMainWindow *m_owner;
|
||||
|
||||
public:
|
||||
wxListRenameTimer( wxListMainWindow *owner );
|
||||
void Notify();
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListTextCtrl (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListTextCtrl: public wxTextCtrl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListTextCtrl);
|
||||
|
||||
private:
|
||||
bool *m_accept;
|
||||
wxString *m_res;
|
||||
wxListMainWindow *m_owner;
|
||||
|
||||
public:
|
||||
wxListTextCtrl(void) : wxTextCtrl() {};
|
||||
wxListTextCtrl( wxWindow *parent, const char *value = "",
|
||||
bool *accept, wxString *res, wxListMainWindow *owner,
|
||||
int x = -1, int y = -1, int w = -1, int h = -1, int style = 0, char *name = "rawtext" ) :
|
||||
wxTextCtrl( parent, value, x, y, w, h, style, name )
|
||||
{
|
||||
m_res = res;
|
||||
m_accept = accept;
|
||||
m_owner = owner;
|
||||
};
|
||||
void OnChar( wxKeyEvent &event )
|
||||
{
|
||||
if (event.keyCode == WXK_RETURN)
|
||||
{
|
||||
(*m_accept) = TRUE;
|
||||
(*m_res) = GetValue();
|
||||
m_owner->OnRenameAccept();
|
||||
// Show( FALSE );
|
||||
delete this;
|
||||
return;
|
||||
};
|
||||
if (event.keyCode == WXK_ESCAPE)
|
||||
{
|
||||
(*m_accept) = FALSE;
|
||||
(*m_res) = "";
|
||||
// Show( FALSE );
|
||||
delete this;
|
||||
return;
|
||||
};
|
||||
};
|
||||
void OnKillFocus(void)
|
||||
{
|
||||
(*m_accept) = FALSE;
|
||||
(*m_res) = "";
|
||||
// Show( FALSE );
|
||||
delete this;
|
||||
return;
|
||||
};
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListMainWindow (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListMainWindow: public wxScrolledWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListMainWindow);
|
||||
|
||||
public:
|
||||
long m_mode;
|
||||
wxList m_lines;
|
||||
wxList m_columns;
|
||||
wxListLineData *m_current;
|
||||
int m_visibleLines;
|
||||
wxBrush *m_hilightBrush;
|
||||
wxColour *m_hilightColour;
|
||||
wxFont *m_myFont;
|
||||
int m_xScroll,m_yScroll;
|
||||
bool m_dirty;
|
||||
wxImageList *m_small_image_list;
|
||||
wxImageList *m_normal_image_list;
|
||||
int m_small_spacing;
|
||||
int m_normal_spacing;
|
||||
bool m_hasFocus;
|
||||
bool m_usedKeys;
|
||||
bool m_lastOnSame;
|
||||
wxTimer *m_renameTimer;
|
||||
// wxListTextCtrl *m_text;
|
||||
bool m_renameAccept;
|
||||
wxString m_renameRes;
|
||||
bool m_isCreated;
|
||||
bool m_isDragging;
|
||||
|
||||
public:
|
||||
wxListMainWindow(void);
|
||||
wxListMainWindow( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
const long style = 0, const wxString &name = "listctrl" );
|
||||
~wxListMainWindow(void);
|
||||
void RefreshLine( wxListLineData *line );
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void HilightAll( const bool on );
|
||||
void ActivateLine( wxListLineData *line );
|
||||
void SendNotify( wxListLineData *line, long command );
|
||||
void FocusLine( wxListLineData *line );
|
||||
void UnfocusLine( wxListLineData *line );
|
||||
void SelectLine( wxListLineData *line );
|
||||
void DeselectLine( wxListLineData *line );
|
||||
void DeleteLine( wxListLineData *line );
|
||||
void RenameLine( wxListLineData *line, const wxString &newName );
|
||||
void OnRenameTimer(void);
|
||||
void OnRenameAccept(void);
|
||||
void OnMouse( wxMouseEvent &event );
|
||||
void MoveToFocus( void );
|
||||
void OnArrowChar( wxListLineData *newCurrent, bool shiftDown );
|
||||
void OnChar( wxKeyEvent &event );
|
||||
void OnSetFocus( wxFocusEvent &event );
|
||||
void OnKillFocus( wxFocusEvent &event );
|
||||
void OnSize( wxSizeEvent &event );
|
||||
wxFont *GetMyFont( void );
|
||||
void DrawImage( int index, wxPaintDC *dc, int x, int y );
|
||||
void GetImageSize( int index, int &width, int &height );
|
||||
int GetIndexOfLine( const wxListLineData *line );
|
||||
int GetTextLength( wxString &s ); // should be const
|
||||
|
||||
void SetImageList( wxImageList *imageList, const int which );
|
||||
void SetItemSpacing( const int spacing, const bool isSmall = FALSE );
|
||||
int GetItemSpacing( const bool isSmall = FALSE );
|
||||
void SetColumn( const int col, wxListItem &item );
|
||||
void SetColumnWidth( const int col, const int width );
|
||||
void GetColumn( const int col, wxListItem &item );
|
||||
int GetColumnWidth( const int vol );
|
||||
int GetColumnCount( void );
|
||||
int GetCountPerPage( void );
|
||||
void SetItem( wxListItem &item );
|
||||
void GetItem( wxListItem &item );
|
||||
void SetItemState( const long item, const long state, const long stateMask );
|
||||
int GetItemState( const long item, const long stateMask );
|
||||
int GetItemCount( void );
|
||||
void GetItemRect( const long index, wxRectangle &rect );
|
||||
int GetSelectedItemCount( void );
|
||||
void SetMode( const long mode );
|
||||
long GetMode( void ) const;
|
||||
void CalculatePositions( void );
|
||||
void RealizeChanges(void);
|
||||
long GetNextItem( const long item, int geometry, int state );
|
||||
void DeleteItem( const long index );
|
||||
void DeleteAllItems( void );
|
||||
void DeleteColumn( const int col );
|
||||
void DeleteEverything( void );
|
||||
void EnsureVisible( const long index );
|
||||
long FindItem(const long start, const wxString& str, const bool partial = FALSE );
|
||||
long FindItem(const long start, const long data);
|
||||
long HitTest( const int x, const int y, int &flags );
|
||||
void InsertItem( wxListItem &item );
|
||||
void InsertColumn( const long col, wxListItem &item );
|
||||
void SortItems( wxListCtrlCompare fn, long data );
|
||||
virtual bool OnListNotify( wxListEvent &event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListCtrl: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListCtrl);
|
||||
|
||||
public:
|
||||
|
||||
wxListCtrl(void);
|
||||
wxListCtrl( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
const long style = 0, const wxString &name = "listctrl" );
|
||||
~wxListCtrl(void);
|
||||
bool Create( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||
const long style = 0, const wxString &name = "listctrl" );
|
||||
void OnSize( wxSizeEvent &event );
|
||||
void SetBackgroundColour( const wxColour& col );
|
||||
bool GetColumn( const int col, wxListItem& item );
|
||||
bool SetColumn( const int col, wxListItem& item );
|
||||
int GetColumnWidth( const int col );
|
||||
bool SetColumnWidth( const int col, const int width);
|
||||
int GetCountPerPage(void); // not the same in wxGLC as in Windows, I think
|
||||
// wxText& GetEditControl(void) const; // not supported in wxGLC
|
||||
bool GetItem( wxListItem& info );
|
||||
bool SetItem( wxListItem& info ) ;
|
||||
long SetItem( const long index, const int col, const wxString& label, const int imageId = -1 );
|
||||
int GetItemState( const long item, const long stateMask );
|
||||
bool SetItemState( const long item, const long state, const long stateMask);
|
||||
bool SetItemImage( const long item, const int image, const int selImage);
|
||||
wxString GetItemText( const long item );
|
||||
void SetItemText( const long item, const wxString& str );
|
||||
long GetItemData( const long item );
|
||||
bool SetItemData( const long item, long data );
|
||||
bool GetItemRect( const long item, wxRectangle& rect, const int code = wxLIST_RECT_BOUNDS ); // not supported in wxGLC
|
||||
bool GetItemPosition( const long item, wxPoint& pos ) const; // not supported in wxGLC
|
||||
bool SetItemPosition( const long item, const wxPoint& pos ); // not supported in wxGLC
|
||||
int GetItemCount(void);
|
||||
int GetItemSpacing( bool isSmall );
|
||||
int GetSelectedItemCount(void);
|
||||
// wxColour GetTextColour(void) const; // wxGLC has colours for every Item (see wxListItem)
|
||||
// void SetTextColour(const wxColour& col);
|
||||
long GetTopItem(void);
|
||||
void SetSingleStyle( const long style, const bool add = TRUE ) ;
|
||||
void SetWindowStyleFlag(const long style);
|
||||
void RecreateWindow(void) {};
|
||||
void RealizeChanges( void ); // whereas this is much needed in wxGLC
|
||||
long GetNextItem(const long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE);
|
||||
wxImageList *GetImageList(const int which);
|
||||
void SetImageList(wxImageList *imageList, const int which) ;
|
||||
bool Arrange( const int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
|
||||
bool DeleteItem( const long item );
|
||||
bool DeleteAllItems(void) ;
|
||||
bool DeleteColumn( const int col );
|
||||
// wxText& Edit(const long item) ; // not supported in wxGLC
|
||||
bool EnsureVisible( const long item );
|
||||
long FindItem(const long start, const wxString& str, const bool partial = FALSE );
|
||||
long FindItem(const long start, const long data);
|
||||
long FindItem(const long start, const wxPoint& pt, const int direction); // not supported in wxGLC
|
||||
long HitTest(const wxPoint& point, int& flags);
|
||||
long InsertItem(wxListItem& info);
|
||||
long InsertItem(const long index, const wxString& label);
|
||||
long InsertItem(const long index, const int imageIndex);
|
||||
long InsertItem(const long index, const wxString& label, const int imageIndex);
|
||||
long InsertColumn(const long col, wxListItem& info);
|
||||
long InsertColumn(const long col, const wxString& heading, const int format = wxLIST_FORMAT_LEFT,
|
||||
const int width = -1);
|
||||
bool ScrollList(const int dx, const int dy);
|
||||
bool SortItems(wxListCtrlCompare fn, long data);
|
||||
bool Update(const long item);
|
||||
virtual bool OnListNotify(wxListEvent& WXUNUSED(event)) { return FALSE; }
|
||||
void SetDropTarget( wxDropTarget *dropTarget )
|
||||
{ m_mainWin->SetDropTarget( dropTarget ); };
|
||||
wxDropTarget *GetDropTarget() const
|
||||
{ return m_mainWin->GetDropTarget(); };
|
||||
|
||||
protected:
|
||||
|
||||
// wxListTextCtrl m_textCtrl;
|
||||
wxImageList *m_imageListNormal;
|
||||
wxImageList *m_imageListSmall;
|
||||
wxImageList *m_imageListState; // what's that ?
|
||||
wxListHeaderWindow *m_headerWin;
|
||||
wxListMainWindow *m_mainWin;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __LISTCTRLH_G__
|
52
include/wx/generic/msgdlgg.h
Normal file
52
include/wx/generic/msgdlgg.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msgdlgg.h
|
||||
// Purpose: Generic wxMessageDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MSGDLGH_G__
|
||||
#define __MSGDLGH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "msgdlgg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
// type is an 'or' (|) of wxOK, wxCANCEL, wxYES_NO
|
||||
// Returns wxYES/NO/OK/CANCEL
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxMessageBoxCaptionStr;
|
||||
|
||||
class WXDLLEXPORT wxGenericMessageDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMessageDialog)
|
||||
protected:
|
||||
long m_dialogStyle;
|
||||
public:
|
||||
wxGenericMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
void OnYes(wxCommandEvent& event);
|
||||
void OnNo(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
#define wxMessageDialog wxGenericMessageDialog
|
||||
|
||||
int wxMessageBox(const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
||||
const long style = wxOK|wxCENTRE, wxWindow *parent = NULL, const int x = -1, const int y = -1);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __MSGDLGH_G__
|
69
include/wx/generic/panelg.h
Normal file
69
include/wx/generic/panelg.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: panelg.h
|
||||
// Purpose: wxPanel: similar to wxWindows but is coloured as for a dialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PANELH_G__
|
||||
#define __PANELH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "panelg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||
|
||||
// Dialog boxes
|
||||
class WXDLLEXPORT wxPanel: public wxWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPanel)
|
||||
public:
|
||||
|
||||
wxPanel(void);
|
||||
|
||||
// Old-style constructor
|
||||
inline wxPanel(wxWindow *parent,
|
||||
const int x = -1, const int y= -1, const int width = 500, const int height = 500,
|
||||
const long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
|
||||
}
|
||||
|
||||
// Constructor
|
||||
inline wxPanel(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Sends an OnInitDialog event, which in turns transfers data to
|
||||
// to the dialog via validators.
|
||||
virtual void InitDialog(void);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __PANELH_G__
|
57
include/wx/generic/printps.h
Normal file
57
include/wx/generic/printps.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: printps.h
|
||||
// Purpose: wxPostScriptPrinter, wxPostScriptPrintPreview
|
||||
// wxGenericPageSetupDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PRINTPSH__
|
||||
#define __PRINTPSH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "printps.h"
|
||||
#endif
|
||||
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
/*
|
||||
* Represents the printer: manages printing a wxPrintout object
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxPostScriptPrinter: public wxPrinterBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptPrinter)
|
||||
|
||||
public:
|
||||
wxPostScriptPrinter(wxPrintData *data = NULL);
|
||||
~wxPostScriptPrinter(void);
|
||||
|
||||
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
|
||||
virtual bool PrintDialog(wxWindow *parent);
|
||||
virtual bool Setup(wxWindow *parent);
|
||||
};
|
||||
|
||||
/*
|
||||
* wxPrintPreview
|
||||
* Programmer creates an object of this class to preview a wxPrintout.
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxPostScriptPrintPreview: public wxPrintPreviewBase
|
||||
{
|
||||
DECLARE_CLASS(wxPostScriptPrintPreview)
|
||||
|
||||
public:
|
||||
wxPostScriptPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL);
|
||||
~wxPostScriptPrintPreview(void);
|
||||
|
||||
virtual bool Print(bool interactive);
|
||||
virtual void DetermineScaling(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __PRINTPSH__
|
145
include/wx/generic/prntdlgg.h
Normal file
145
include/wx/generic/prntdlgg.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: prntdlgg.h
|
||||
// Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
|
||||
// wxGenericPageSetupDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PRINTDLGH_G_
|
||||
#define __PRINTDLGH_G_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "prntdlgg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/postscrp.h"
|
||||
|
||||
class WXDLLEXPORT wxTextCtrl;
|
||||
class WXDLLEXPORT wxButton;
|
||||
class WXDLLEXPORT wxCheckBox;
|
||||
class WXDLLEXPORT wxChoice;
|
||||
class WXDLLEXPORT wxStaticText;
|
||||
class WXDLLEXPORT wxRadioBox;
|
||||
|
||||
/*
|
||||
* Simulated Print and Print Setup dialogs
|
||||
* for non-Windows platforms (and Windows using PostScript print/preview)
|
||||
*/
|
||||
|
||||
#define wxPRINTID_STATIC 10
|
||||
#define wxPRINTID_RANGE 11
|
||||
#define wxPRINTID_FROM 12
|
||||
#define wxPRINTID_TO 13
|
||||
#define wxPRINTID_COPIES 14
|
||||
#define wxPRINTID_PRINTTOFILE 15
|
||||
#define wxPRINTID_SETUP 16
|
||||
|
||||
class WXDLLEXPORT wxGenericPrintDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
|
||||
|
||||
public:
|
||||
wxStaticText *printerMessage;
|
||||
wxButton *setupButton;
|
||||
wxButton *helpButton;
|
||||
wxRadioBox *rangeRadioBox;
|
||||
wxTextCtrl *fromText;
|
||||
wxTextCtrl *toText;
|
||||
wxTextCtrl *noCopiesText;
|
||||
wxCheckBox *printToFileCheckBox;
|
||||
wxCheckBox *collateCopiesCheckBox;
|
||||
|
||||
wxPrintData printData;
|
||||
wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
|
||||
~wxGenericPrintDialog(void);
|
||||
|
||||
void OnSetup(wxCommandEvent& event);
|
||||
void OnRange(wxCommandEvent& event);
|
||||
void OnOK(wxCommandEvent& event);
|
||||
|
||||
virtual bool TransferDataFromWindow(void);
|
||||
virtual bool TransferDataToWindow(void);
|
||||
|
||||
virtual int ShowModal(void);
|
||||
|
||||
inline wxPrintData& GetPrintData(void) { return printData; }
|
||||
wxDC *GetPrintDC(void);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#define wxPRINTID_PRINTCOLOUR 10
|
||||
#define wxPRINTID_ORIENTATION 11
|
||||
#define wxPRINTID_COMMAND 12
|
||||
#define wxPRINTID_OPTIONS 13
|
||||
#define wxPRINTID_PAPERSIZE 14
|
||||
|
||||
class WXDLLEXPORT wxGenericPrintSetupDialog: public wxDialog
|
||||
{
|
||||
DECLARE_CLASS(wxGenericPrintSetupDialog)
|
||||
|
||||
public:
|
||||
wxRadioBox *orientationRadioBox;
|
||||
wxTextCtrl *printerCommandText;
|
||||
wxTextCtrl *printerOptionsText;
|
||||
wxCheckBox *colourCheckBox;
|
||||
wxChoice *paperTypeChoice;
|
||||
|
||||
wxPrintSetupData printData;
|
||||
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintSetupData* data);
|
||||
~wxGenericPrintSetupDialog(void);
|
||||
|
||||
virtual bool TransferDataFromWindow(void);
|
||||
virtual bool TransferDataToWindow(void);
|
||||
|
||||
wxChoice *CreatePaperTypeChoice(int* x, int* y);
|
||||
inline wxPrintSetupData& GetPrintData(void) { return printData; }
|
||||
};
|
||||
|
||||
#define wxPRINTID_LEFTMARGIN 30
|
||||
#define wxPRINTID_RIGHTMARGIN 31
|
||||
#define wxPRINTID_TOPMARGIN 32
|
||||
#define wxPRINTID_BOTTOMMARGIN 33
|
||||
|
||||
class WXDLLEXPORT wxGenericPageSetupDialog: public wxDialog
|
||||
{
|
||||
DECLARE_CLASS(wxGenericPageSetupDialog)
|
||||
|
||||
public:
|
||||
wxButton *printerButton;
|
||||
wxRadioBox *orientationRadioBox;
|
||||
wxTextCtrl *marginLeftText;
|
||||
wxTextCtrl *marginTopText;
|
||||
wxTextCtrl *marginRightText;
|
||||
wxTextCtrl *marginBottomText;
|
||||
wxChoice *paperTypeChoice;
|
||||
|
||||
static bool pageSetupDialogCancelled;
|
||||
|
||||
wxPageSetupData pageData;
|
||||
|
||||
wxGenericPageSetupDialog(wxWindow *parent, wxPageSetupData* data = NULL);
|
||||
~wxGenericPageSetupDialog(void);
|
||||
|
||||
virtual bool TransferDataFromWindow(void);
|
||||
virtual bool TransferDataToWindow(void);
|
||||
|
||||
void OnPrinter(wxCommandEvent& event);
|
||||
|
||||
wxChoice *CreatePaperTypeChoice(int* x, int* y);
|
||||
inline wxPageSetupData& GetPageSetupData(void) { return pageData; }
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __PRINTDLGH_G__
|
141
include/wx/generic/scrolwin.h
Normal file
141
include/wx/generic/scrolwin.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: scrolwin.h
|
||||
// Purpose: wxScrolledWindow class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __SCROLWINH_G__
|
||||
#define __SCROLWINH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "scrolwin.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||
|
||||
class WXDLLEXPORT wxScrolledWindow: public wxWindow
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxScrolledWindow)
|
||||
|
||||
public:
|
||||
wxScrolledWindow(void);
|
||||
inline wxScrolledWindow(wxWindow *parent, const wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxHSCROLL|wxVSCROLL,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
inline ~wxScrolledWindow(void) {}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxHSCROLL|wxVSCROLL,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
// Set client size
|
||||
// Should take account of scrollbars
|
||||
// virtual void SetClientSize(const int width, const int size);
|
||||
|
||||
// Is the window retained?
|
||||
// inline bool IsRetained(void) const;
|
||||
|
||||
// Number of pixels per user unit (0 or -1 for no scrollbar)
|
||||
// Length of virtual canvas in user units
|
||||
// Length of page in user units
|
||||
virtual void SetScrollbars(const int pixelsPerUnitX, const int pixelsPerUnitY,
|
||||
const int noUnitsX, const int noUnitsY,
|
||||
const int xPos = 0, const int yPos = 0,
|
||||
const bool noRefresh = FALSE );
|
||||
|
||||
// Physically scroll the window
|
||||
virtual void Scroll(const int x_pos, const int y_pos);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
virtual void GetScrollUnitsPerPage(int *x_page, int *y_page) const;
|
||||
#endif
|
||||
|
||||
int GetScrollPageSize(int orient) const ;
|
||||
void SetScrollPageSize(int orient, int pageSize);
|
||||
|
||||
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
|
||||
// Enable/disable Windows scrolling in either direction.
|
||||
// If TRUE, wxWindows scrolls the canvas and only a bit of
|
||||
// the canvas is invalidated; no Clear() is necessary.
|
||||
// If FALSE, the whole canvas is invalidated and a Clear() is
|
||||
// necessary. Disable for when the scroll increment is used
|
||||
// to actually scroll a non-constant distance
|
||||
virtual void EnableScrolling(const bool x_scrolling, const bool y_scrolling);
|
||||
|
||||
// Get the view start
|
||||
virtual void ViewStart(int *x, int *y) const;
|
||||
|
||||
// Actual size in pixels when scrolling is taken into account
|
||||
virtual void GetVirtualSize(int *x, int *y) const;
|
||||
|
||||
virtual void CalcScrolledPosition(const int x, const int y, int *xx, int *yy) const ;
|
||||
virtual void CalcUnscrolledPosition(const int x, const int y, float *xx, float *yy) const ;
|
||||
|
||||
// Adjust the scrollbars
|
||||
virtual void AdjustScrollbars(void);
|
||||
|
||||
/*
|
||||
#if WXWIN_COMPATIBILITY
|
||||
virtual void OldOnScroll(wxCommandEvent& WXUNUSED(event));
|
||||
virtual void OldOnPaint(void); // Called when needs painting
|
||||
virtual void OldOnSize(int width, int height); // Called on resize
|
||||
virtual void OldOnMouseEvent(wxMouseEvent& event); // Called on mouse event
|
||||
virtual void OldOnChar(wxKeyEvent& event); // Called on character event
|
||||
#endif
|
||||
*/
|
||||
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Override this function to draw the graphic.
|
||||
virtual void OnDraw(wxDC& WXUNUSED(dc)) {};
|
||||
|
||||
// Override this function if you don't want to have wxScrolledWindow
|
||||
// automatically change the origin according to the scroll position.
|
||||
virtual void PrepareDC(wxDC& dc);
|
||||
|
||||
public:
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// IMPLEMENTATION
|
||||
|
||||
// Calculate scroll increment
|
||||
virtual int CalcScrollInc(wxScrollEvent& event);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// PROTECTED DATA
|
||||
protected:
|
||||
int m_xScrollPixelsPerLine;
|
||||
int m_yScrollPixelsPerLine;
|
||||
bool m_xScrollingEnabled;
|
||||
bool m_yScrollingEnabled;
|
||||
int m_xScrollPosition;
|
||||
int m_yScrollPosition;
|
||||
int m_xScrollLines;
|
||||
int m_yScrollLines;
|
||||
int m_xScrollLinesPerPage;
|
||||
int m_yScrollLinesPerPage;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// INLINES
|
||||
|
||||
#endif
|
||||
// __SCROLWINH_G__
|
180
include/wx/generic/splitter.h
Normal file
180
include/wx/generic/splitter.h
Normal file
@@ -0,0 +1,180 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: splitter.h
|
||||
// Purpose: wxSplitterWindow class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __SPLITTERH_G__
|
||||
#define __SPLITTERH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "splitter.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
#define WXSPLITTER_VERSION 1.0
|
||||
|
||||
#define wxSPLIT_HORIZONTAL 1
|
||||
#define wxSPLIT_VERTICAL 2
|
||||
|
||||
#define wxSPLIT_DRAG_NONE 0
|
||||
#define wxSPLIT_DRAG_DRAGGING 1
|
||||
#define wxSPLIT_DRAG_LEFT_DOWN 2
|
||||
|
||||
/*
|
||||
* wxSplitterWindow maintains one or two panes, with
|
||||
* an optional vertical or horizontal split which
|
||||
* can be used with the mouse or programmatically.
|
||||
*/
|
||||
|
||||
// TODO:
|
||||
// 1) Perhaps make the borders sensitive to dragging in order to create a split.
|
||||
// The MFC splitter window manages scrollbars as well so is able to
|
||||
// put sash buttons on the scrollbars, but we probably don't want to go down
|
||||
// this path.
|
||||
// 2) for wxWindows 2.0, we must find a way to set the WS_CLIPCHILDREN style
|
||||
// to prevent flickering. (WS_CLIPCHILDREN doesn't work in all cases so can't be
|
||||
// standard).
|
||||
|
||||
class WXDLLEXPORT wxSplitterWindow: public wxWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSplitterWindow)
|
||||
|
||||
public:
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Public API
|
||||
|
||||
// Default constructor
|
||||
wxSplitterWindow(void);
|
||||
|
||||
// Normal constructor
|
||||
wxSplitterWindow(wxWindow *parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = wxSP_3D, const wxString& name = "splitter");
|
||||
~wxSplitterWindow(void);
|
||||
|
||||
// Gets the only or left/top pane
|
||||
inline wxWindow *GetWindow1(void) { return m_windowOne; }
|
||||
|
||||
// Gets the right/bottom pane
|
||||
inline wxWindow *GetWindow2(void) { return m_windowTwo; }
|
||||
|
||||
// Sets the split mode
|
||||
inline void SetSplitMode(const int mode) { m_splitMode = mode; }
|
||||
|
||||
// Gets the split mode
|
||||
inline int GetSplitMode(void) const { return m_splitMode; };
|
||||
|
||||
// Initialize with one window
|
||||
void Initialize(wxWindow *window);
|
||||
|
||||
// Associates the given window with window 2, drawing the appropriate sash
|
||||
// and changing the split mode.
|
||||
// Does nothing and returns FALSE if the window is already split.
|
||||
// A sashPosition of -1 means choose a default sash position.
|
||||
bool SplitVertically(wxWindow *window1, wxWindow *window2, const int sashPosition = -1);
|
||||
bool SplitHorizontally(wxWindow *window1, wxWindow *window2, const int sashPosition = -1);
|
||||
|
||||
// Removes the specified (or second) window from the view
|
||||
// Doesn't actually delete the window.
|
||||
bool Unsplit(wxWindow *toRemove = NULL);
|
||||
|
||||
// Is the window split?
|
||||
inline bool IsSplit(void) const { return (m_windowTwo != NULL); }
|
||||
|
||||
// Sets the sash size
|
||||
inline void SetSashSize(const int width) { m_sashSize = width; }
|
||||
|
||||
// Sets the border size
|
||||
inline void SetBorderSize(const int width) { m_borderSize = width; }
|
||||
|
||||
// Gets the sash size
|
||||
inline int GetSashSize(void) const { return m_sashSize; }
|
||||
|
||||
// Gets the border size
|
||||
inline int GetBorderSize(void) const { return m_borderSize; }
|
||||
|
||||
// Set the sash position
|
||||
void SetSashPosition(const int position, const bool redaw = TRUE);
|
||||
|
||||
// Gets the sash position
|
||||
inline int GetSashPosition(void) const { return m_sashPosition; }
|
||||
|
||||
// If this is zero, we can remove panes by dragging the sash.
|
||||
inline void SetMinimumPaneSize(const int min) { m_minimumPaneSize = min; }
|
||||
inline int GetMinimumPaneSize(void) const { return m_minimumPaneSize; }
|
||||
|
||||
// If the sash is moved to an extreme position, a subwindow
|
||||
// is removed from the splitter window, and the app is
|
||||
// notified. The app should delete or hide the window.
|
||||
virtual void OnUnsplit(wxWindow *removed) { removed->Show(FALSE); }
|
||||
|
||||
// Called when the sash is double-clicked.
|
||||
// The default behaviour is to remove the sash if the
|
||||
// minimum pane size is zero.
|
||||
virtual void OnDoubleClickSash(int x, int y);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
|
||||
// Paints the border and sash
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Handles mouse events
|
||||
void OnMouseEvent(wxMouseEvent& ev);
|
||||
|
||||
// Adjusts the panes
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
// Draws borders
|
||||
void DrawBorders(wxDC& dc);
|
||||
|
||||
// Draws the sash
|
||||
void DrawSash(wxDC& dc);
|
||||
|
||||
// Draws the sash tracker (for whilst moving the sash)
|
||||
void DrawSashTracker(const int x, const int y);
|
||||
|
||||
// Tests for x, y over sash
|
||||
bool SashHitTest(const int x, const int y, const int tolerance = 2);
|
||||
|
||||
// Resizes subwindows
|
||||
void SizeWindows(void);
|
||||
|
||||
// Initialize colours
|
||||
void InitColours(void);
|
||||
|
||||
protected:
|
||||
int m_splitMode;
|
||||
wxWindow* m_windowOne;
|
||||
wxWindow* m_windowTwo;
|
||||
int m_dragMode;
|
||||
int m_oldX;
|
||||
int m_oldY;
|
||||
int m_borderSize;
|
||||
int m_sashSize; // Sash width or height
|
||||
int m_sashPosition; // Number of pixels from left or top
|
||||
int m_firstX;
|
||||
int m_firstY;
|
||||
int m_minimumPaneSize;
|
||||
wxCursor* m_sashCursorWE;
|
||||
wxCursor* m_sashCursorNS;
|
||||
wxPen* m_sashTrackerPen;
|
||||
wxPen* m_lightShadowPen;
|
||||
wxPen* m_mediumShadowPen;
|
||||
wxPen* m_darkShadowPen;
|
||||
wxPen* m_hilightPen;
|
||||
wxBrush* m_faceBrush;
|
||||
wxPen* m_facePen;
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
92
include/wx/generic/statusbr.h
Normal file
92
include/wx/generic/statusbr.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statusbr.h
|
||||
// Purpose: wxStatusBar class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __STATUSBRH_G__
|
||||
#define __STATUSBRH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statusbr.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStatusBar: public wxWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStatusBar)
|
||||
|
||||
public:
|
||||
wxStatusBar(void);
|
||||
inline wxStatusBar(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxStatusBar(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
// Create status line
|
||||
virtual void SetFieldsCount(const int number=1, const int *widths = NULL);
|
||||
inline int GetFieldsCount(void) const { return m_nFields; }
|
||||
|
||||
// Set status line text
|
||||
virtual void SetStatusText(const wxString& text, const int number = 0);
|
||||
virtual wxString GetStatusText(const int number = 0) const;
|
||||
|
||||
// Set status line widths
|
||||
virtual void SetStatusWidths(const int n, const int *widths_field);
|
||||
|
||||
virtual void DrawFieldText(wxDC& dc, const int i);
|
||||
virtual void DrawField(wxDC& dc, const int i);
|
||||
|
||||
// Get the position and size of the field's internal bounding rectangle
|
||||
virtual bool GetFieldRect(const int i, wxRectangle& rect) const;
|
||||
|
||||
inline int GetBorderX(void) const { return m_borderX; }
|
||||
inline int GetBorderY(void) const { return m_borderY; }
|
||||
inline void SetBorderX(const int x);
|
||||
inline void SetBorderY(const int y);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
virtual void InitColours(void);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
protected:
|
||||
int * m_statusWidths;
|
||||
int m_nFields;
|
||||
wxString * m_statusStrings;
|
||||
int m_borderX;
|
||||
int m_borderY;
|
||||
wxFont m_defaultStatusBarFont;
|
||||
wxPen m_mediumShadowPen;
|
||||
wxPen m_hilightPen;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __STATUSBRH_G__
|
343
include/wx/generic/tabg.h
Normal file
343
include/wx/generic/tabg.h
Normal file
@@ -0,0 +1,343 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabg.h
|
||||
// Purpose: Generic tabbed dialogs
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TABGH_G__
|
||||
#define __TABGH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "tabg.h"
|
||||
#endif
|
||||
|
||||
#define WXTAB_VERSION 1.1
|
||||
|
||||
#include "wx/hash.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
class wxTabView;
|
||||
|
||||
/*
|
||||
* A wxTabControl is the internal and visual representation
|
||||
* of the tab.
|
||||
*/
|
||||
|
||||
class wxTabControl: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabControl)
|
||||
public:
|
||||
wxTabControl(wxTabView *v = NULL);
|
||||
~wxTabControl(void);
|
||||
|
||||
virtual void OnDraw(wxDC& dc, bool lastInRow);
|
||||
inline void SetLabel(const wxString& str) { m_controlLabel = str; }
|
||||
inline wxString GetLabel(void) const { return m_controlLabel; }
|
||||
|
||||
inline void SetFont(wxFont *f) { m_labelFont = f; }
|
||||
inline wxFont *GetFont(void) const { return m_labelFont; }
|
||||
|
||||
inline void SetSelected(bool sel) { m_isSelected = sel; }
|
||||
inline bool IsSelected(void) const { return m_isSelected; }
|
||||
|
||||
inline void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; }
|
||||
inline void SetSize(int x, int y) { m_width = x; m_height = y; }
|
||||
|
||||
inline void SetRowPosition(int r) { m_rowPosition = r; }
|
||||
inline int GetRowPosition() const { return m_rowPosition; }
|
||||
inline void SetColPosition(int c) { m_colPosition = c; }
|
||||
inline int GetColPosition() const { return m_colPosition; }
|
||||
|
||||
inline int GetX(void) const { return m_offsetX; }
|
||||
inline int GetY(void) const { return m_offsetY; }
|
||||
inline int GetWidth(void) const { return m_width; }
|
||||
inline int GetHeight(void) const { return m_height; }
|
||||
|
||||
inline int GetId(void) const { return m_id; }
|
||||
inline void SetId(int i) { m_id = i; }
|
||||
|
||||
virtual bool HitTest(int x, int y) const ;
|
||||
|
||||
protected:
|
||||
wxTabView* m_view;
|
||||
wxString m_controlLabel;
|
||||
bool m_isSelected;
|
||||
wxFont* m_labelFont;
|
||||
int m_offsetX; // Offsets from top-left of tab view area (the area below the tabs)
|
||||
int m_offsetY;
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_id;
|
||||
int m_rowPosition; // Position in row from 0
|
||||
int m_colPosition; // Position in col from 0
|
||||
};
|
||||
|
||||
/*
|
||||
* Each wxTabLayer is a list of tabs. E.g. there
|
||||
* are 3 layers in the MS Word Options dialog.
|
||||
*/
|
||||
|
||||
class wxTabLayer: public wxList
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabLayer)
|
||||
public:
|
||||
wxTabLayer(void)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* The wxTabView controls and draws the tabbed object
|
||||
*/
|
||||
|
||||
#define wxTAB_STYLE_DRAW_BOX 1 // Draws 3D boxes round tab layers
|
||||
#define wxTAB_STYLE_COLOUR_INTERIOR 2 // Colours interior of tabs, otherwise draws outline
|
||||
|
||||
class wxTabView: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabView)
|
||||
public:
|
||||
wxTabView(long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
|
||||
~wxTabView();
|
||||
|
||||
inline int GetNumberOfLayers() const { return m_layers.Number(); }
|
||||
inline wxList& GetLayers() { return m_layers; }
|
||||
|
||||
inline void SetWindow(wxWindow* wnd) { m_window = wnd; }
|
||||
inline wxWindow* GetWindow(void) const { return m_window; }
|
||||
|
||||
// Automatically positions tabs
|
||||
wxTabControl *AddTab(int id, const wxString& label, wxTabControl *existingTab = NULL);
|
||||
|
||||
void ClearTabs(bool deleteTabs = TRUE);
|
||||
|
||||
// Layout tabs (optional, e.g. if resizing window)
|
||||
void Layout(void);
|
||||
|
||||
// Draw all tabs
|
||||
virtual void Draw(wxDC& dc);
|
||||
|
||||
// Process mouse event, return FALSE if we didn't process it
|
||||
virtual bool OnEvent(wxMouseEvent& event);
|
||||
|
||||
// Called when a tab is activated
|
||||
virtual void OnTabActivate(int activateId, int deactivateId);
|
||||
// Allows vetoing
|
||||
virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return TRUE; };
|
||||
|
||||
// Allows use of application-supplied wxTabControl classes.
|
||||
virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); }
|
||||
|
||||
void SetHighlightColour(const wxColour& col);
|
||||
void SetShadowColour(const wxColour& col);
|
||||
void SetBackgroundColour(const wxColour& col);
|
||||
inline void SetTextColour(const wxColour& col) { m_textColour = col; }
|
||||
|
||||
inline wxColour GetHighlightColour(void) const { return m_highlightColour; }
|
||||
inline wxColour GetShadowColour(void) const { return m_shadowColour; }
|
||||
inline wxColour GetBackgroundColour(void) const { return m_backgroundColour; }
|
||||
inline wxColour GetTextColour(void) const { return m_textColour; }
|
||||
inline wxPen *GetHighlightPen(void) const { return m_highlightPen; }
|
||||
inline wxPen *GetShadowPen(void) const { return m_shadowPen; }
|
||||
inline wxPen *GetBackgroundPen(void) const { return m_backgroundPen; }
|
||||
inline wxBrush *GetBackgroundBrush(void) const { return m_backgroundBrush; }
|
||||
|
||||
inline void SetViewRect(const wxRectangle& rect) { m_tabViewRect = rect; }
|
||||
inline wxRect GetViewRect(void) const { return m_tabViewRect; }
|
||||
|
||||
// Calculate tab width to fit to view, and optionally adjust the view
|
||||
// to fit the tabs exactly.
|
||||
int CalculateTabWidth(int noTabs, bool adjustView = FALSE);
|
||||
|
||||
inline void SetTabStyle(long style) { m_tabStyle = style; }
|
||||
inline long GetTabStyle(void) const { return m_tabStyle; }
|
||||
|
||||
inline void SetTabSize(int w, int h) { m_tabWidth = w; m_tabHeight = h; }
|
||||
inline int GetTabWidth(void) const { return m_tabWidth; }
|
||||
inline int GetTabHeight(void) const { return m_tabHeight; }
|
||||
inline void SetTabSelectionHeight(int h) { m_tabSelectionHeight = h; }
|
||||
inline int GetTabSelectionHeight(void) const { return m_tabSelectionHeight; }
|
||||
|
||||
inline int GetTopMargin(void) const { return m_topMargin; }
|
||||
inline void SetTopMargin(int margin) { m_topMargin = margin; }
|
||||
|
||||
void SetTabSelection(int sel, bool activateTool = TRUE);
|
||||
inline int GetTabSelection() const { return m_tabSelection; }
|
||||
|
||||
// Find tab control for id
|
||||
wxTabControl *FindTabControlForId(int id) const ;
|
||||
|
||||
// Find tab control for layer, position (starting from zero)
|
||||
wxTabControl *FindTabControlForPosition(int layer, int position) const ;
|
||||
|
||||
inline int GetHorizontalTabOffset() const { return m_tabHorizontalOffset; }
|
||||
inline int GetHorizontalTabSpacing() const { return m_tabHorizontalSpacing; }
|
||||
inline void SetHorizontalTabOffset(int sp) { m_tabHorizontalOffset = sp; }
|
||||
inline void SetHorizontalTabSpacing(int sp) { m_tabHorizontalSpacing = sp; }
|
||||
|
||||
inline void SetVerticalTabTextSpacing(int s) { m_tabVerticalTextSpacing = s; }
|
||||
inline int GetVerticalTabTextSpacing() const { return m_tabVerticalTextSpacing; }
|
||||
|
||||
inline wxFont *GetTabFont() const { return m_tabFont; }
|
||||
inline void SetTabFont(wxFont *f) { m_tabFont = f; }
|
||||
|
||||
inline wxFont *GetSelectedTabFont() const { return m_tabSelectedFont; }
|
||||
inline void SetSelectedTabFont(wxFont *f) { m_tabSelectedFont = f; }
|
||||
// Find the node and the column at which this control is positioned.
|
||||
wxNode *FindTabNodeAndColumn(wxTabControl *control, int *col) const ;
|
||||
|
||||
// Do the necessary to change to this tab
|
||||
virtual bool ChangeTab(wxTabControl *control);
|
||||
|
||||
// Move the selected tab to the bottom layer, if necessary,
|
||||
// without calling app activation code
|
||||
bool MoveSelectionTab(wxTabControl *control);
|
||||
|
||||
inline int GetNumberOfTabs() const { return m_noTabs; }
|
||||
|
||||
protected:
|
||||
// List of layers, from front to back.
|
||||
wxList m_layers;
|
||||
|
||||
// Selected tab
|
||||
int m_tabSelection;
|
||||
|
||||
// Usual tab height
|
||||
int m_tabHeight;
|
||||
|
||||
// The height of the selected tab
|
||||
int m_tabSelectionHeight;
|
||||
|
||||
// Usual tab width
|
||||
int m_tabWidth;
|
||||
|
||||
// Space between tabs
|
||||
int m_tabHorizontalSpacing;
|
||||
|
||||
// Space between top of normal tab and text
|
||||
int m_tabVerticalTextSpacing;
|
||||
|
||||
// Horizontal offset of each tab row above the first
|
||||
int m_tabHorizontalOffset;
|
||||
|
||||
// The distance between the bottom of the first tab row
|
||||
// and the top of the client area (i.e. the margin)
|
||||
int m_topMargin;
|
||||
|
||||
// The position and size of the view above which the tabs are placed.
|
||||
// I.e., the internal client area of the sheet.
|
||||
wxRect m_tabViewRect;
|
||||
|
||||
// Bitlist of styles
|
||||
long m_tabStyle;
|
||||
|
||||
// Colours
|
||||
wxColour m_highlightColour;
|
||||
wxColour m_shadowColour;
|
||||
wxColour m_backgroundColour;
|
||||
wxColour m_textColour;
|
||||
|
||||
// Pen and brush cache
|
||||
wxPen* m_highlightPen;
|
||||
wxPen* m_shadowPen;
|
||||
wxPen* m_backgroundPen;
|
||||
wxBrush* m_backgroundBrush;
|
||||
|
||||
wxFont* m_tabFont;
|
||||
wxFont* m_tabSelectedFont;
|
||||
|
||||
int m_noTabs;
|
||||
|
||||
wxWindow* m_window;
|
||||
};
|
||||
|
||||
/*
|
||||
* A dialog box class that is tab-friendly
|
||||
*/
|
||||
|
||||
class wxTabbedDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabbedDialog)
|
||||
|
||||
public:
|
||||
|
||||
wxTabbedDialog(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxDialogNameStr);
|
||||
~wxTabbedDialog(void);
|
||||
|
||||
inline wxTabView *GetTabView() const { return m_tabView; }
|
||||
inline void SetTabView(wxTabView *v) { m_tabView = v; }
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
protected:
|
||||
wxTabView* m_tabView;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
/*
|
||||
* A panel class that is tab-friendly
|
||||
*/
|
||||
|
||||
class wxTabbedPanel: public wxPanel
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabbedPanel)
|
||||
|
||||
public:
|
||||
|
||||
wxTabbedPanel(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long windowStyle = 0, const wxString& name = wxPanelNameStr);
|
||||
~wxTabbedPanel(void);
|
||||
|
||||
inline wxTabView *GetTabView() const { return m_tabView; }
|
||||
inline void SetTabView(wxTabView *v) { m_tabView = v; }
|
||||
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
protected:
|
||||
wxTabView* m_tabView;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class wxPanelTabView: public wxTabView
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPanelTabView)
|
||||
public:
|
||||
wxPanelTabView(wxPanel *pan, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
|
||||
~wxPanelTabView(void);
|
||||
|
||||
// Called when a tab is activated
|
||||
virtual void OnTabActivate(int activateId, int deactivateId);
|
||||
|
||||
// Specific to this class
|
||||
void AddTabWindow(int id, wxWindow *window);
|
||||
wxWindow *GetTabWindow(int id) const ;
|
||||
void ClearWindows(bool deleteWindows = TRUE);
|
||||
inline wxWindow *GetCurrentWindow() const { return m_currentWindow; }
|
||||
|
||||
void ShowWindowForTab(int id);
|
||||
|
||||
protected:
|
||||
// List of panels, one for each tab. Indexed
|
||||
// by tab ID.
|
||||
wxList m_tabWindows;
|
||||
wxWindow* m_currentWindow;
|
||||
wxPanel* m_panel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
51
include/wx/generic/textdlgg.h
Normal file
51
include/wx/generic/textdlgg.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: textdlgg.h
|
||||
// Purpose: wxStatusBar class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TEXTDLGH_G__
|
||||
#define __TEXTDLGH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "textdlgg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
// Handy dialog functions (will be converted into classes at some point)
|
||||
WXDLLEXPORT_DATA(extern const char*) wxGetTextFromUserPromptStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
#define wxID_TEXT 3000
|
||||
|
||||
class WXDLLEXPORT wxTextEntryDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
|
||||
protected:
|
||||
long m_dialogStyle;
|
||||
wxString m_value;
|
||||
public:
|
||||
wxTextEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
|
||||
const wxString& value = wxEmptyString, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline void SetValue(const wxString& val) { m_value = val; }
|
||||
inline wxString GetValue(void) const { return m_value; }
|
||||
|
||||
void OnOK(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
wxString WXDLLEXPORT wxGetTextFromUser(const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
|
||||
const wxString& default_value = wxEmptyString, wxWindow *parent = NULL,
|
||||
int x = -1, int y = -1, bool centre = TRUE);
|
||||
|
||||
#endif
|
||||
// __TEXTDLGH_G__
|
300
include/wx/generic/treectrl.h
Normal file
300
include/wx/generic/treectrl.h
Normal file
@@ -0,0 +1,300 @@
|
||||
/*
|
||||
* Author: Robert Roebling
|
||||
*
|
||||
* Copyright: (C) 1997,1998 Robert Roebling
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the wxWindows Licence, which
|
||||
* you have received with this library (see Licence.htm).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __GTKTREECTRLH_G__
|
||||
#define __GTKTREECTRLH_G__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxTreeItem;
|
||||
class wxTreeEvent;
|
||||
|
||||
class wxGenericTreeItem;
|
||||
class wxTreeCtrl;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// WXDLLEXPORT extern const char *wxTreeNameStr;
|
||||
|
||||
#define wxTREE_MASK_HANDLE 0x0001
|
||||
#define wxTREE_MASK_STATE 0x0002
|
||||
#define wxTREE_MASK_TEXT 0x0004
|
||||
#define wxTREE_MASK_IMAGE 0x0008
|
||||
#define wxTREE_MASK_SELECTED_IMAGE 0x0010
|
||||
#define wxTREE_MASK_CHILDREN 0x0020
|
||||
#define wxTREE_MASK_DATA 0x0040
|
||||
|
||||
#define wxTREE_STATE_BOLD 0x0001
|
||||
#define wxTREE_STATE_DROPHILITED 0x0002
|
||||
#define wxTREE_STATE_EXPANDED 0x0004
|
||||
#define wxTREE_STATE_EXPANDEDONCE 0x0008
|
||||
#define wxTREE_STATE_FOCUSED 0x0010
|
||||
#define wxTREE_STATE_SELECTED 0x0020
|
||||
#define wxTREE_STATE_CUT 0x0040
|
||||
|
||||
#define wxTREE_HITTEST_ABOVE 0x0001 // Above the client area.
|
||||
#define wxTREE_HITTEST_BELOW 0x0002 // Below the client area.
|
||||
#define wxTREE_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
|
||||
#define wxTREE_HITTEST_ONITEMBUTTON 0x0010 // On the button associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMINDENT 0x0040 // In the indentation associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
|
||||
#define wxTREE_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
|
||||
#define wxTREE_HITTEST_TOLEFT 0x0400 // To the right of the client area.
|
||||
#define wxTREE_HITTEST_TORIGHT 0x0800 // To the left of the client area.
|
||||
|
||||
#define wxTREE_HITTEST_ONITEM (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL wxTREE_HITTEST_ONITEMSTATEICON)
|
||||
|
||||
// Flags for GetNextItem
|
||||
enum {
|
||||
wxTREE_NEXT_CARET, // Retrieves the currently selected item.
|
||||
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
||||
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
||||
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
||||
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
||||
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
||||
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
||||
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
||||
wxTREE_NEXT_PREVIOUSVISIBLE, // Retrieves the first visible item that precedes the specified item.
|
||||
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
||||
};
|
||||
|
||||
// Flags for ExpandItem
|
||||
enum {
|
||||
wxTREE_EXPAND_EXPAND,
|
||||
wxTREE_EXPAND_COLLAPSE,
|
||||
wxTREE_EXPAND_COLLAPSE_RESET,
|
||||
wxTREE_EXPAND_TOGGLE
|
||||
};
|
||||
|
||||
// Flags for InsertItem
|
||||
enum {
|
||||
wxTREE_INSERT_LAST = -1,
|
||||
wxTREE_INSERT_FIRST = -2,
|
||||
wxTREE_INSERT_SORT = -3
|
||||
};
|
||||
|
||||
/* defined in "wx/event.h"
|
||||
wxEVT_COMMAND_TREE_BEGIN_DRAG,
|
||||
wxEVT_COMMAND_TREE_BEGIN_RDRAG,
|
||||
wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT,
|
||||
wxEVT_COMMAND_TREE_END_LABEL_EDIT,
|
||||
wxEVT_COMMAND_TREE_DELETE_ITEM,
|
||||
wxEVT_COMMAND_TREE_GET_INFO,
|
||||
wxEVT_COMMAND_TREE_SET_INFO,
|
||||
wxEVT_COMMAND_TREE_ITEM_EXPANDED,
|
||||
wxEVT_COMMAND_TREE_ITEM_EXPANDING,
|
||||
wxEVT_COMMAND_TREE_SEL_CHANGED,
|
||||
wxEVT_COMMAND_TREE_SEL_CHANGING,
|
||||
wxEVT_COMMAND_TREE_KEY_DOWN
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTreeItem
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTreeItem: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
||||
|
||||
public:
|
||||
long m_mask;
|
||||
long m_itemId;
|
||||
long m_state;
|
||||
long m_stateMask;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
int m_selectedImage;
|
||||
int m_children;
|
||||
long m_data;
|
||||
|
||||
wxTreeItem(void);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTreeEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
||||
|
||||
public:
|
||||
wxTreeEvent(WXTYPE commandType = 0, int id = 0);
|
||||
|
||||
int m_code;
|
||||
wxTreeItem m_item;
|
||||
long m_oldItem;
|
||||
wxPoint m_pointDrag;
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
||||
|
||||
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericTreeItem
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGenericTreeItem: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericTreeItem)
|
||||
|
||||
public:
|
||||
|
||||
long m_itemId;
|
||||
long m_state;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
int m_selectedImage;
|
||||
// int m_children;
|
||||
bool m_hasChildren;
|
||||
long m_data;
|
||||
|
||||
int m_x,m_y;
|
||||
int m_height,m_width;
|
||||
int m_xCross,m_yCross;
|
||||
int m_level;
|
||||
wxList m_children;
|
||||
wxGenericTreeItem *m_parent;
|
||||
bool m_hasHilight;
|
||||
|
||||
wxGenericTreeItem(void) {};
|
||||
wxGenericTreeItem( wxGenericTreeItem *parent );
|
||||
wxGenericTreeItem( wxGenericTreeItem *parent, const wxTreeItem& item, wxDC *dc );
|
||||
void SetItem( const wxTreeItem &item, wxDC *dc );
|
||||
void SetText( const wxString &text, wxDC *dc );
|
||||
void Reset(void);
|
||||
void GetItem( wxTreeItem &item ) const;
|
||||
void AddChild( const wxTreeItem &item );
|
||||
bool HasChildren(void);
|
||||
bool HasPlus(void);
|
||||
int NumberOfVisibleDescendents(void);
|
||||
int NumberOfVisibleChildren(void);
|
||||
wxGenericTreeItem *FindItem( long itemId ) const;
|
||||
void AddChild( wxGenericTreeItem *child );
|
||||
void SetCross( int x, int y );
|
||||
void GetSize( int &x, int &y );
|
||||
long HitTest( const wxPoint& point, int &flags );
|
||||
void PrepareEvent( wxTreeEvent &event );
|
||||
void SendKeyDown( wxWindow *target );
|
||||
void SendSelected( wxWindow *target );
|
||||
void SendDelete( wxWindow *target );
|
||||
void SendExpand( wxWindow *target );
|
||||
void SetHilight( bool set = TRUE );
|
||||
bool HasHilight(void);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTreeCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxTreeCtrl: public wxScrolledWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||
|
||||
public:
|
||||
|
||||
wxTreeCtrl(void);
|
||||
wxTreeCtrl(wxWindow *parent, const wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxTR_HAS_BUTTONS,
|
||||
const wxString& name = "wxTreeCtrl" );
|
||||
~wxTreeCtrl(void);
|
||||
bool Create(wxWindow *parent, const wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxTR_HAS_BUTTONS,
|
||||
const wxString& name = "wxTreeCtrl");
|
||||
|
||||
int GetCount(void) const;
|
||||
long InsertItem( const long parent, const wxString& label, const int image = -1,
|
||||
const int selImage = -1, const long insertAfter = wxTREE_INSERT_LAST );
|
||||
long InsertItem( const long parent, wxTreeItem &info, const long insertAfter = wxTREE_INSERT_LAST );
|
||||
bool DeleteAllItems(void);
|
||||
bool ExpandItem( const long item, const int action );
|
||||
bool GetItem( wxTreeItem &info ) const;
|
||||
long GetItemData( const long item ) const;
|
||||
wxString GetItemText( const long item ) const;
|
||||
long GetParent( const long item ) const;
|
||||
long GetRootItem(void) const;
|
||||
long GetSelection(void) const;
|
||||
bool SelectItem( const long item ) const;
|
||||
bool ItemHasChildren( const long item ) const;
|
||||
void SetIndent( const int indent );
|
||||
int GetIndent(void) const;
|
||||
bool SetItem( wxTreeItem &info );
|
||||
bool SetItemData( const long item, const long data );
|
||||
bool SetItemText( const long item, const wxString &text );
|
||||
long HitTest( const wxPoint& point, int &flags );
|
||||
|
||||
void AdjustMyScrollbars(void);
|
||||
void PaintLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y );
|
||||
void OnPaint( const wxPaintEvent &event );
|
||||
void OnSetFocus( const wxFocusEvent &event );
|
||||
void OnKillFocus( const wxFocusEvent &event );
|
||||
void OnChar( wxKeyEvent &event );
|
||||
void OnMouse( const wxMouseEvent &event );
|
||||
|
||||
private:
|
||||
|
||||
wxGenericTreeItem *m_anchor;
|
||||
wxGenericTreeItem *m_current;
|
||||
bool m_hasFocus;
|
||||
int m_xScroll,m_yScroll;
|
||||
int m_indent;
|
||||
long m_lastId;
|
||||
int m_lineHeight;
|
||||
wxPen m_dottedPen;
|
||||
bool m_isCreated;
|
||||
wxPaintDC *m_dc;
|
||||
wxBrush *m_hilightBrush;
|
||||
|
||||
void CalculateLevel( wxGenericTreeItem *item, wxPaintDC &dc, int level, int &y );
|
||||
void CalculatePositions(void);
|
||||
wxGenericTreeItem *FindItem( const long itemId ) const;
|
||||
void RefreshLine( wxGenericTreeItem *item );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __GTKTREECTRLH_G__
|
Reference in New Issue
Block a user