Initial revision

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1998-05-20 14:01:55 +00:00
parent 1b66e7e5ab
commit c801d85f15
779 changed files with 172138 additions and 0 deletions

61
include/wx/app.h Normal file
View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose: wxApp inclusion
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __APPH_BASE__
#define __APPH_BASE__
/*
class WXDLLEXPORT wxApp;
typedef wxApp* (*wxAppInitializerFunction) (void);
*/
#include "wx/object.h"
typedef wxObject* (*wxAppInitializerFunction) (void); // returning wxApp* won't work with gcc
#if defined(__WINDOWS__)
#include "wx/msw/app.h"
#elif defined(__MOTIF__)
#include "wx/xt/app.h"
#elif defined(__GTK__)
#include "wx/gtk/app.h"
#endif
// Having a global instance of this class allows
// wxApp to be aware of the app creator function.
// wxApp can then call this function to create a new
// app object. Convoluted, but necessary.
class WXDLLEXPORT wxAppInitializer
{
public:
wxAppInitializer(wxAppInitializerFunction fn)
{
wxApp::SetInitializerFunction(fn);
}
};
#define IMPLEMENT_APP(appname) \
wxApp *wxCreateApp(void) { return new appname; } \
wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
appname& wxGetApp(void) { return *(appname *)wxTheApp; } \
\
extern int wxEntry( int argc, char *argv[] ); \
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
#define DECLARE_APP(appname) \
extern appname& wxGetApp(void) ;
#endif
// __APPH_BASE__

13
include/wx/bitmap.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __BITMAPH_BASE__
#define __BITMAPH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/bitmap.h"
#elif defined(__MOTIF__)
#include "wx/xt/bitmap.h"
#elif defined(__GTK__)
#include "wx/gtk/bitmap.h"
#endif
#endif
// __BITMAPH_BASE__

12
include/wx/bmpbuttn.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef __BMPBUTTONH_BASE__
#define __BMPBUTTONH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/bmpbuttn.h"
#elif defined(__MOTIF__)
#include "wx/xt/bmpbuttn.h"
#elif defined(__GTK__)
#include "wx/gtk/bmpbuttn.h"
#endif
#endif

13
include/wx/brush.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __BRUSHH_BASE__
#define __BRUSHH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/brush.h"
#elif defined(__MOTIF__)
#include "wx/xt/brush.h"
#elif defined(__GTK__)
#include "wx/gtk/brush.h"
#endif
#endif
// __BRUSHH_BASE__

13
include/wx/button.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __BUTTONH_BASE__
#define __BUTTONH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/button.h"
#elif defined(__MOTIF__)
#include "wx/xt/button.h"
#elif defined(__GTK__)
#include "wx/gtk/button.h"
#endif
#endif
// __BUTTONH_BASE__

13
include/wx/checkbox.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __CHECKBOXH_BASE__
#define __CHECKBOXH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/checkbox.h"
#elif defined(__MOTIF__)
#include "wx/xt/checkbox.h"
#elif defined(__GTK__)
#include "wx/gtk/checkbox.h"
#endif
#endif
// __CHECKBOXH_BASE__

7
include/wx/choicdlg.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef __CHOICDLGH_BASE__
#define __CHOICDLGH_BASE__
#include "wx/generic/choicdgg.h"
#endif
// __CHOICDLGH_BASE__

13
include/wx/choice.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __CHOICEH_BASE__
#define __CHOICEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/choice.h"
#elif defined(__MOTIF__)
#include "wx/xt/choice.h"
#elif defined(__GTK__)
#include "wx/gtk/choice.h"
#endif
#endif
// __CHOICEH_BASE__

13
include/wx/clipbrd.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __CLIPBRDH_BASE__
#define __CLIPBRDH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/clipbrd.h"
#elif defined(__MOTIF__)
#include "wx/xt/clipbrd.h"
#elif defined(__GTK__)
#include "wx/gtk/clipbrd.h"
#endif
#endif
// __CLIPBRDH_BASE__

223
include/wx/cmndata.h Normal file
View File

@@ -0,0 +1,223 @@
/////////////////////////////////////////////////////////////////////////////
// Name: cmndata.h
// Purpose: Common GDI data classes
// Author: Julian Smart and others
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __CMNDATAH_BASE__
#define __CMNDATAH_BASE__
#ifdef __GNUG__
#pragma interface "cmndata.h"
#endif
class WXDLLEXPORT wxColourData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxColourData)
public:
wxColour dataColour;
wxColour custColours[16];
bool chooseFull;
wxColourData(void);
~wxColourData(void);
inline void SetChooseFull(bool flag) { chooseFull = flag; }
inline bool GetChooseFull(void) { return chooseFull; }
inline void SetColour(wxColour& colour) { dataColour = colour; }
inline wxColour &GetColour(void) { return dataColour; }
// Array of 16 custom colours
void SetCustomColour(int i, wxColour& colour);
wxColour GetCustomColour(int i);
void operator=(const wxColourData& data);
};
class WXDLLEXPORT wxFontData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFontData)
public:
wxColour fontColour;
bool showHelp;
bool allowSymbols;
bool enableEffects;
wxFont initialFont;
wxFont chosenFont;
int minSize;
int maxSize;
wxFontData(void);
~wxFontData(void);
inline void SetAllowSymbols(bool flag) { allowSymbols = flag; }
inline bool GetAllowSymbols(void) { return allowSymbols; }
inline void SetColour(const wxColour& colour) { fontColour = colour; }
inline wxColour &GetColour(void) { return fontColour; }
inline void SetShowHelp(bool flag) { showHelp = flag; }
inline bool GetShowHelp(void) { return showHelp; }
inline void EnableEffects(bool flag) { enableEffects = flag; }
inline bool GetEnableEffects(void) { return enableEffects; }
inline void SetInitialFont(const wxFont& font) { initialFont = font; }
inline wxFont GetInitialFont(void) { return initialFont; }
inline void SetChosenFont(const wxFont& font) { chosenFont = font; }
inline wxFont GetChosenFont(void) { return chosenFont; }
inline void SetRange(int minRange, int maxRange) { minSize = minRange; maxSize = maxRange; }
void operator=(const wxFontData& data);
};
/*
* wxPrintData
* Encapsulates information displayed and edited in the printer dialog box.
*/
class WXDLLEXPORT wxPrintData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxPrintData)
public:
#ifdef __WINDOWS__
void *printData;
#endif
int printFromPage;
int printToPage;
int printMinPage;
int printMaxPage;
int printNoCopies;
int printOrientation;
bool printAllPages;
bool printCollate;
bool printToFile;
bool printEnableSelection;
bool printEnablePageNumbers;
bool printEnableHelp;
bool printEnablePrintToFile;
bool printSetupDialog;
wxPrintData(void);
~wxPrintData(void);
inline int GetFromPage(void) { return printFromPage; };
inline int GetToPage(void) { return printToPage; };
inline int GetMinPage(void) { return printMinPage; };
inline int GetMaxPage(void) { return printMaxPage; };
inline int GetNoCopies(void) { return printNoCopies; };
inline bool GetAllPages(void) { return printAllPages; };
inline bool GetCollate(void) { return printCollate; };
inline bool GetPrintToFile(void) { return printToFile; };
inline bool GetSetupDialog(void) { return printSetupDialog; };
inline int GetOrientation(void) { return printOrientation; };
inline void SetFromPage(int v) { printFromPage = v; };
inline void SetToPage(int v) { printToPage = v; };
inline void SetMinPage(int v) { printMinPage = v; };
inline void SetMaxPage(int v) { printMaxPage = v; };
inline void SetNoCopies(int v) { printNoCopies = v; };
inline void SetAllPages(bool flag) { printAllPages = flag; };
inline void SetCollate(bool flag) { printCollate = flag; };
inline void SetPrintToFile(bool flag) { printToFile = flag; };
inline void SetSetupDialog(bool flag) { printSetupDialog = flag; };
inline void SetOrientation(int orient) { printOrientation = orient; };
inline void EnablePrintToFile(bool flag) { printEnablePrintToFile = flag; };
inline void EnableSelection(bool flag) { printEnableSelection = flag; };
inline void EnablePageNumbers(bool flag) { printEnablePageNumbers = flag; };
inline void EnableHelp(bool flag) { printEnableHelp = flag; };
inline bool GetEnablePrintToFile(void) { return printEnablePrintToFile; };
inline bool GetEnableSelection(void) { return printEnableSelection; };
inline bool GetEnablePageNumbers(void) { return printEnablePageNumbers; };
inline bool GetEnableHelp(void) { return printEnableHelp; };
void operator=(const wxPrintData& data);
#ifdef __WINDOWS__
// Convert to/from the PRINTDLG structure
void ConvertToNative(void);
void ConvertFromNative(void);
void SetOwnerWindow(wxWindow* win);
inline void* GetNativeData(void) { return printData; }
#endif
};
/*
* This is the data used (and returned) by the wxPageSetupDialog.
*/
class WXDLLEXPORT wxPageSetupData: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxPageSetupData)
public:
#if defined(__WIN95__)
void* m_pageSetupData;
#endif
wxPoint m_paperSize;
wxPoint m_minMarginTopLeft;
wxPoint m_minMarginBottomRight;
wxPoint m_marginTopLeft;
wxPoint m_marginBottomRight;
int m_orientation;
// Flags
bool m_defaultMinMargins;
bool m_enableMargins;
bool m_enableOrientation;
bool m_enablePaper;
bool m_enablePrinter;
bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT
bool m_enableHelp;
wxPageSetupData(void);
~wxPageSetupData(void);
inline wxPoint GetPaperSize(void) { return m_paperSize; };
inline wxPoint GetMinMarginTopLeft(void) { return m_minMarginTopLeft; };
inline wxPoint GetMinMarginBottomRight(void) { return m_minMarginBottomRight; };
inline wxPoint GetMarginTopLeft(void) { return m_marginTopLeft; };
inline wxPoint GetMarginBottomRight(void) { return m_marginBottomRight; };
inline int GetOrientation(void) { return m_orientation; };
inline bool GetDefaultMinMargins(void) { return m_defaultMinMargins; };
inline bool GetEnableMargins(void) { return m_enableMargins; };
inline bool GetEnableOrientation(void) { return m_enableOrientation; };
inline bool GetEnablePaper(void) { return m_enablePaper; };
inline bool GetEnablePrinter(void) { return m_enablePrinter; };
inline bool GetDefaultInfo(void) { return m_getDefaultInfo; };
inline bool GetEnableHelp(void) { return m_enableHelp; };
inline void SetPaperSize(const wxPoint& pt) { m_paperSize = pt; };
inline void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; };
inline void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; };
inline void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; };
inline void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; };
inline void SetOrientation(int orient) { m_orientation = orient; };
inline void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; };
inline void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; };
inline void EnableMargins(bool flag) { m_enableMargins = flag; };
inline void EnableOrientation(bool flag) { m_enableOrientation = flag; };
inline void EnablePaper(bool flag) { m_enablePaper = flag; };
inline void EnablePrinter(bool flag) { m_enablePrinter = flag; };
inline void EnableHelp(bool flag) { m_enableHelp = flag; };
#if defined(__WIN95__)
// Convert to/from the PAGESETUPDLG structure
void ConvertToNative(void);
void ConvertFromNative(void);
void SetOwnerWindow(wxWindow* win);
inline void* GetNativeData(void) { return m_pageSetupData; }
#endif
void operator=(const wxPageSetupData& data);
};
#endif
// __CMNDATAH_BASE__

13
include/wx/colordlg.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __COLORDLGH_BASE__
#define __COLORDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/colordlg.h"
#elif defined(__MOTIF__)
#include "wx/generic/colrdlgg.h"
#elif defined(__GTK__)
#include "wx/generic/colrdlgg.h"
#endif
#endif
// __COLORDLGH_BASE__

13
include/wx/combobox.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __COMBOBOXH_BASE__
#define __COMBOBOXH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/combobox.h"
#elif defined(__MOTIF__)
#include "wx/xt/combobox.h"
#elif defined(__GTK__)
#include "wx/gtk/combobox.h"
#endif
#endif
// __COMBOBOXH_BASE__

121
include/wx/config.h Normal file
View File

@@ -0,0 +1,121 @@
///////////////////////////////////////////////////////////////////////////////
// Name:
// Purpose:
// Author: Karsten Ball<6C>der & Vadim Zeitlin
// Modified by:
// Created: 07.04.98 (adapted from appconf.h)
// RCS-ID: $Id$
// Copyright: (c) 1997 Karsten Ball<6C>der Ballueder@usa.net
// Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _APPCONF_H
#define _APPCONF_H
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
/// shall we be case sensitive in parsing variable names?
#ifndef APPCONF_CASE_SENSITIVE
#define APPCONF_CASE_SENSITIVE FALSE
#endif
/// separates group and entry names
#ifndef APPCONF_PATH_SEPARATOR
#define APPCONF_PATH_SEPARATOR '/'
#endif
/// introduces immutable entries
#ifndef APPCONF_IMMUTABLE_PREFIX
#define APPCONF_IMMUTABLE_PREFIX '!'
#endif
/// should we use registry instead of configuration files under Win32?
#ifndef APPCONF_WIN32_NATIVE
#define APPCONF_WIN32_NATIVE TRUE
#endif
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
/*
Replace environment variables ($SOMETHING) with their values. The format is
$VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and
'_' only. '$' must be escaped ('\$') in order to be taken literally.
*/
wxString ExpandEnvVars(const wxString& str);
// ----------------------------------------------------------------------------
// abstract base class wxConfig which defines the interface for derived classes
//
// wxConfig organizes the items in a tree-like structure (modeled after the
// Unix/Dos filesystem). There are groups (directories) and keys (files).
// There is always one current group given by the current path.
//
// Keys are pairs "key_name = value" where value may be of string or integer
// (long) type (@@@ doubles and other types such as wxDate coming soon).
// ----------------------------------------------------------------------------
class wxConfig
{
public:
// ctor & virtual dtor
wxConfig() { }
virtual ~wxConfig();
// path management
// set current path: if the first character is '/', it's the absolute path,
// otherwise it's a relative path. '..' is supported. If the strPath
// doesn't exist it is created.
virtual void SetPath(const wxString& strPath) = 0;
// retrieve the current path (always as absolute path)
virtual const wxString& GetPath() const = 0;
// enumeration: all functions here return false when there are no more items.
// you must pass the same lIndex to GetNext and GetFirst (don't modify it)
// enumerate subgroups
virtual bool GetFirstGroup(wxString& str, long& lIndex) = 0;
virtual bool GetNextGroup (wxString& str, long& lIndex) = 0;
// enumerate entries
virtual bool GetFirstEntry(wxString& str, long& lIndex) = 0;
virtual bool GetNextEntry (wxString& str, long& lIndex) = 0;
// key access
// read a string or long value from the key. If the key is not
// found the default value is returned.
virtual const char *Read(const char *szKey,
const char *szDefault = NULL) const = 0;
virtual long Read(const char *szKey, long lDefault) const = 0;
// write the value (return true on success)
virtual bool Write(const char *szKey, const char *szValue) = 0;
virtual bool Write(const char *szKey, long lValue) = 0;
// permanently writes all changes
virtual bool Flush(bool bCurrentOnly = FALSE) = 0;
// delete entries/groups
// deletes the specified entry and the group it belongs to if
// it was the last key in it and the second parameter is true
virtual bool DeleteEntry(const char *szKey,
bool bDeleteGroupIfEmpty = TRUE) = 0;
// delete the group (with all subgroups)
virtual bool DeleteGroup(const char *szKey) = 0;
// delete the whole underlying object (disk file, registry key, ...)
// primarly for use by desinstallation routine.
virtual bool DeleteAll() = 0;
protected:
// true if environment variables are to be auto-expanded
bool m_bExpandEnvVars;
};
// ----------------------------------------------------------------------------
// functions to create different config implementations
// ----------------------------------------------------------------------------
wxConfig *CreateFileConfig(const wxString& strFile, bool bLocalOnly = FALSE);
#endif //_APPCONF_H

13
include/wx/control.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __CONTROLH_BASE__
#define __CONTROLH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/control.h"
#elif defined(__MOTIF__)
#include "wx/xt/control.h"
#elif defined(__GTK__)
#include "wx/gtk/control.h"
#endif
#endif
// __CONTROLH_BASE__

13
include/wx/cursor.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __CURSORH_BASE__
#define __CURSORH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/cursor.h"
#elif defined(__MOTIF__)
#include "wx/xt/cursor.h"
#elif defined(__GTK__)
#include "wx/gtk/cursor.h"
#endif
#endif
// __CURSORH_BASE__

131
include/wx/date.h Normal file
View File

@@ -0,0 +1,131 @@
/////////////////////////////////////////////////////////////////////////////
// Name: date.h
// Purpose: wxDate class
// Author: Julian Smart, Steve Marcus, Eric Simon, Chris Hill,
// Charles D. Price
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WXDATEH__
#define __WXDATEH__
#ifdef __GNUG__
#pragma interface "date.h"
#endif
#include "wx/object.h"
#include "wx/string.h"
#if USE_TIMEDATE
enum wxdate_format_type {wxMDY, wxDAY, wxMONTH, wxFULL, wxEUROPEAN};
#define wxNO_CENTURY 0x02
#define wxDATE_ABBR 0x04
class WXDLLEXPORT wxDate: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxDate)
protected:
unsigned long julian; // see julDate(); days since 1/1/4713 B.C.
int month; // see NMonth()
int day; // see Day()
int year; // see NYear4()
int day_of_week; // see NDOW(); 1 = Sunday, ... 7 = Saturday
private:
int DisplayFormat;
unsigned char DisplayOptions;
void julian_to_mdy (); // convert julian day to mdy
void julian_to_wday (); // convert julian day to day_of_week
void mdy_to_julian (); // convert mdy to julian day
public:
wxDate ();
wxDate (const long j);
wxDate (const int m, const int d, const int y);
wxDate (const wxString& dat);
wxDate (const wxDate &dt);
operator wxString (void);
void operator = (const wxDate& date);
void operator = (const wxString& date);
wxDate operator + (const long i);
wxDate operator + (const int i);
wxDate operator - (const long i);
wxDate operator - (const int i);
long operator - (const wxDate &dt);
wxDate &operator += (const long i);
wxDate &operator -= (const long i);
wxDate &operator ++ (); // Prefix increment
wxDate &operator ++ (int); // Postfix increment
wxDate &operator -- (); // Prefix decrement
wxDate &operator -- (int); // Postfix decrement
friend bool operator < (const wxDate &dt1, const wxDate &dt2);
friend bool operator <= (const wxDate &dt1, const wxDate &dt2);
friend bool operator > (const wxDate &dt1, const wxDate &dt2);
friend bool operator >= (const wxDate &dt1, const wxDate &dt2);
friend bool operator == (const wxDate &dt1, const wxDate &dt2);
friend bool operator != (const wxDate &dt1, const wxDate &dt2);
friend ostream &operator << (ostream &os, const wxDate &dt);
wxString FormatDate (const int type=-1) const;
void SetFormat (const int format);
int SetOption (const int option, const bool enable=TRUE);
long GetJulianDate() const; // returns julian date
int GetDayOfYear() const; // returns relative date since Jan. 1
bool IsLeapYear() const; // returns TRUE if leap year, FALSE if not
// Version 4.0 Extension to Public Interface - CDP
// These 'Set's modify the date object and actually SET it
// They all return a reference to self (*this)
wxDate &Set(); // Sets to current system date
wxDate &Set(long lJulian);
wxDate &Set(int nMonth, int nDay, int nYear);
wxDate &AddWeeks(int nCount = 1); //
wxDate &AddMonths(int nCount = 1); // May also pass neg# to decrement
wxDate &AddYears(int nCount = 1); //
int GetDay() const; // Numeric Day of date object
int GetDaysInMonth(); // Number of days in month (1..31)
int GetFirstDayOfMonth() const; // First Day Of Month (1..7)
wxString GetDayOfWeekName(); // Character Day Of Week ('Sunday'..'Saturday')
int GetDayOfWeek() const; // (1..7)
int GetWeekOfMonth(); // Numeric Week Of Month (1..6)
int GetWeekOfYear(); // Numeric Week Of Year (1..52)
wxString GetMonthName(); // Character Month name
int GetMonth() const; // Month Number (1..12)
wxDate GetMonthStart(); // First Date Of Month
wxDate GetMonthEnd(); // Last Date Of Month
int GetYear() const; // eg. 1992
wxDate GetYearStart(); // First Date Of Year
wxDate GetYearEnd(); // Last Date Of Year
bool IsBetween(const wxDate& first, const wxDate& second) const;
wxDate Previous(const int dayOfWeek) const;
};
#endif
#endif
// __WXDATEH__

13
include/wx/dc.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __DCH_BASE__
#define __DCH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dc.h"
#elif defined(__MOTIF__)
#include "wx/xt/dc.h"
#elif defined(__GTK__)
#include "wx/gtk/dc.h"
#endif
#endif
// __DCH_BASE__

13
include/wx/dcclient.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __DCCLIENTH_BASE__
#define __DCCLIENTH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcclient.h"
#elif defined(__MOTIF__)
#include "wx/xt/dcclient.h"
#elif defined(__GTK__)
#include "wx/gtk/dcclient.h"
#endif
#endif
// __DCCLIENTH_BASE__

13
include/wx/dcmemory.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __DCMEMORYH_BASE__
#define __DCMEMORYH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcmemory.h"
#elif defined(__MOTIF__)
#include "wx/xt/dcmemory.h"
#elif defined(__GTK__)
#include "wx/gtk/dcmemory.h"
#endif
#endif
// __DCMEMORYH_BASE__

9
include/wx/dcprint.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef __DCPRINTH_BASE__
#define __DCPRINTH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcprint.h"
#endif
#endif
// __DCPRINTH_BASE__

13
include/wx/dcscreen.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __DCSCREENH_BASE__
#define __DCSCREENH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dcscreen.h"
#elif defined(__MOTIF__)
#include "wx/xt/dcscreen.h"
#elif defined(__GTK__)
#include "wx/gtk/dcscreen.h"
#endif
#endif
// __DCSCREENH_BASE__

13
include/wx/dde.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __DDEH_BASE__
#define __DDEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dde.h"
#elif defined(__MOTIF__)
#include "wx/xt/dde.h"
#elif defined(__GTK__)
#include "wx/gtk/dde.h"
#endif
#endif
// __DDEH_BASE__

94
include/wx/debug.h Normal file
View File

@@ -0,0 +1,94 @@
/////////////////////////////////////////////////////////////////////////////
// Name: debug.h
// Purpose: Misc debug functions and macros
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __DEBUGH__
#define __DEBUGH__
#include <assert.h>
// ----------------------------------------------------------------------------
/**
@name Debugging macros
All debugging macros rely on ASSERT() which in turn calls user-defined
OnAssert() function. To keep things simple, it's called even when the
expression is TRUE (i.e. everything is ok) and by default does nothing: just
returns the same value back. But if you redefine it to do something more sexy
(popping up a message box in your favourite GUI, sending you e-mail or
whatever) it will affect all ASSERTs, FAILs and CHECKs in your code.
<BR>
<BR>
<b>Warning</b>: if you don't like advices on programming style, don't read
further! ;-)
<BR>
<BR>
Extensive use of these macros is recommended! Remember that ASSERTs are
disabled in final (without DEBUG defined) build, so they add strictly
nothing to your program's code. On the other hand, CHECK macros do stay
even in release builds, but in general are not much of a burden, while
a judicious use of them might increase your program's stability.
@memo Debugging macros (replacement for standard assert()) and more.
*/
// ----------------------------------------------------------------------------
//@{
/** @name Macros which are completely disabled in 'release' mode */
//@{
#ifdef __DEBUG__
/**
this function may be redefined to do something non trivial and is called
whenever one of debugging macros fails (i.e. condition is false in an
assertion)
@param szFile and nLine - file name and line number of the ASSERT
szMsg - optional message explaining the reason
*/
void wxOnAssert(const char *szFile, int nLine, const char *szMsg = NULL);
/// generic assert macro
#define wxASSERT(cond) if ( !(cond) ) wxOnAssert(__FILE__, __LINE__)
/// assert with additional message explaining it's cause
#define wxASSERT_MSG(x, m) if ( !(x) ) wxOnAssert(__FILE__, __LINE__, m)
#else
// nothing to do in release modes (hopefully at this moment there are
// no more bugs ;-)
#define wxASSERT(cond)
#define wxASSERT_MSG(x, m)
#endif //DEBUG
/// special form of assert: always triggers it (in debug mode)
#define wxFAIL wxASSERT(0)
/// FAIL with some message
#define wxFAIL_MSG(msg) wxASSERT_MSG(0, msg)
//@}
// NB: these macros work also in release mode!
/**
These macros must be used only in invalid situation: for example, an
invalid parameter (NULL pointer) is passed to a function. Instead of
dereferencing it and causing core dump the function might try using
CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") )
@name Macros which remain even in 'release' mode
*/
//@{
/// check that expression is true, "return" if not (also FAILs in debug mode)
#define wxCHECK(x) if (!(x)) {wxFAIL; return; }
/// check that expression is true, "return ret" if not
#define wxCHECK_RET(x, ret) if (!(x)) {wxFAIL; return ret; }
/// check that expression is true, perform op if not
#define wxCHECK2(x, op) if (!(x)) {wxFAIL; op; }
//@}
//@}
#endif // __DEBUGH__

861
include/wx/defs.h Normal file
View File

@@ -0,0 +1,861 @@
/////////////////////////////////////////////////////////////////////////////
// Name: defs.h
// Purpose: Declarations/definitions common to all wx source files
// Author: Julian Smart and others
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __DEFSH__
#define __DEFSH__
#ifdef __GNUG__
#pragma interface "defs.h"
#endif
#ifdef __GTK__
#include "glib.h"
#include "gdk/gdk.h"
#include "gtk/gtk.h"
#endif
#include <stddef.h>
#include "wx/setup.h"
#include "wx/version.h"
// Helps SGI compilation, apparently
#if defined(__SGI__) && defined(__GNUG__)
#define __need_wchar_t
#endif
// Eliminate double/float warnings
#ifdef _MSC_VER
# pragma warning(disable:4244)
#endif
//////////////////////////////////////////////////////////////////////////////////
// Currently Only MS-Windows/NT, XView and Motif are supported
//
#if defined(__HPUX__) && !defined(__MOTIF__)
# define __MOTIF__
#endif
#if defined(__MOTIF__)
# define __X__
#elif defined(__WINDOWS__) || defined(__WINDOWS_386__) || defined(__NT__) || defined(__MSDOS__)
# ifndef __WINDOWS__
# define __WINDOWS__
# endif
#endif
// wxWindows checks for WIN32, not __WIN32__
#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__))
#define __WIN32__
#endif
#ifndef __WIN32__
#define __WIN16__
#endif
#if !defined(__WIN95__) && (WINVER >= 0x0400)
#define __WIN95__
#endif
// Make sure the environment is set correctly
#if defined(__WINDOWS__) && defined(__X__)
# error "Target can't be both X and Windows"
#elif !defined(__MOTIF__) && !defined(__WINDOWS__) && !defined(__GTK__) && !defined(__MAC__) && !defined(__X__)
#error "No Target! Use -D[__MOTIF__|__GTK__|__WINDOWS__|__MAC__]"
#endif
#if defined(__MOTIF__) || defined(__GTK__)
// Bool is now obsolete, use bool instead
// typedef int Bool;
#ifndef TRUE
# define TRUE 1
# define FALSE 0
# define Bool_DEFINED
#endif
#elif defined(__WINDOWS__)
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
#endif
// VC++ 4.0 is 1000.
// Add more tests here for compilers that don't already define bool.
#if ( defined(_MSC_VER) && (_MSC_VER <= 1000) ) || (defined(__BORLANDC__) && (__BORLANDC__ < 0x500))
typedef unsigned int bool;
#endif
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__)
#define byte unsigned char
#endif
typedef short int WXTYPE;
typedef int wxWindowID;
// Macro to cut down on compiler warnings.
#if REMOVE_UNUSED_ARG
#define WXUNUSED(identifier) /* identifier */
#else // stupid, broken compiler
#define WXUNUSED(identifier) identifier
#endif
/*
* Making or using wxWindows as a Windows DLL
*/
#ifdef __WINDOWS__
#ifdef __BORLANDC__
# ifdef WXMAKINGDLL
# define WXDLLEXPORT __export
# define WXDLLEXPORT_DATA(type) type __export
# define WXDLLEXPORT_CTORFN __export
# elif defined(WXUSINGDLL)
# define WXDLLEXPORT __import
# define WXDLLEXPORT_DATA(type) type __import
# define WXDLLEXPORT_CTORFN
# else
# define WXDLLEXPORT
# define WXDLLEXPORT_DATA(type) type
# define WXDLLEXPORT_CTORFN
# endif
#else
# ifdef WXMAKINGDLL
# define WXDLLEXPORT __declspec( dllexport )
# define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
# define WXDLLEXPORT_CTORFN __declspec( dllexport )
# elif defined(WXUSINGDLL)
# define WXDLLEXPORT __declspec( dllimport )
# define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type
# define WXDLLEXPORT_CTORFN
# else
# define WXDLLEXPORT
# define WXDLLEXPORT_DATA(type) type
# define WXDLLEXPORT_CTORFN
# endif
#endif
#else
// Non-Windows
# define WXDLLEXPORT
# define WXDLLEXPORT_DATA(type) type
# define WXDLLEXPORT_CTORFN
#endif
// For ostream, istream ofstream
#if defined(__BORLANDC__) && defined( _RTLDLL )
# define WXDLLIMPORT __import
#else
# define WXDLLIMPORT
#endif
class WXDLLEXPORT wxObject;
class WXDLLEXPORT wxEvent;
// Vadim's types - check whether we need them all
/// the type for various indexes (string, arrays, ...)
typedef unsigned int uint;
/// extended boolean type: { yes, no, may be }
typedef signed int EBool;
/// with TRUE and FALSE is a possible value for a "3-state" boolean var
#define UNKNOWN (-1)
/** symbolic constant used by all Find()-like functions returning positive
integer on success as failure indicator */
#define NOT_FOUND (-1)
/** useful for Windows programmers: makes somewhat more clear all these
zeroes being passed to Windows APIs */
#define RESERVED (NULL)
// ----------------------------------------------------------------------------
// Error codes
// ----------------------------------------------------------------------------
/// Standard error codes
enum ErrCode
{
/// invalid parameter (in broad sense)
ERR_PARAM = (-4000),
/// no more data (iteration functions usually return this)
ERR_NODATA,
/// user cancelled the operation
ERR_CANCEL,
/// no error (the only non negative error code)
ERR_SUCCESS = 0
};
// ----------------------------------------------------------------------------
/** @name Very common macros */
// ----------------------------------------------------------------------------
//@{
/// delete pointer if it is not NULL
#define DELETEP(p) if ( (p) != NULL ) delete (p)
/// delete array pointer if it is not NULL
#define DELETEA(p) if ( (p) != NULL ) delete [] (p)
/// size of statically declared array
#define WXSIZEOF(array) (sizeof(array)/sizeof(array[0]))
// ----------------------------------------------------------------------------
// compiler and OS identification
// ----------------------------------------------------------------------------
// OS
#if defined(__HPUX__) || defined(____SVR4____) || defined(__LINUX__)
#ifndef __UNIX__
#define __UNIX__
#endif
#endif
#ifndef __UNIX__ // Windows
#ifndef __WINDOWS__
#define __WINDOWS__
#endif
#if defined(_MSC_VER)
#define __VISUALC__
#elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
#define __BORLANDC__
#elif defined(__WATCOMC__)
//#define __WATCOMC__
#elif defined(__SC__)
#define __SYMANTECC__
#endif // compiler
#endif // OS
#if defined(__UNIX__)
#define FILE_PATH_SEPARATOR ('/')
#elif defined(__WINDOWS__)
#define FILE_PATH_SEPARATOR ('\\')
#else
#error "don't know path separator for this platform"
#endif
// ----------------------------------------------------------------------------
// compiler specific settings
// ----------------------------------------------------------------------------
// to allow compiling with warning level 4 under Microsoft Visual C++ some
// warnings just must be disabled
#ifdef __VISUALC__
#pragma warning(disable: 4514) // unreferenced inline func has been removed
/*
you might be tempted to disable this one also: triggered by CHECK and FAIL
macros in debug.h, but it's, overall, is a rather useful one, so I leave it
and will try to find some way to disable this warning just for CHECK/FAIL.
Anyone?
*/
#pragma warning(disable: 4127) // conditional expression is constant
#endif // VC++
// Callback function type definition
typedef void (*wxFunction) (wxObject&, wxEvent&);
/*
* Window style flags.
* Values are chosen so they can be |'ed in a bit list.
* Some styles are used across more than one group,
* so the values mustn't clash with others in the group.
* Otherwise, numbers can be reused across groups.
*
* From version 1.66:
* Window (cross-group) styles now take up the first half
* of the flag, and control-specific styles the
* second half.
*
*/
/*
* Window (Frame/dialog/subwindow/panel item) style flags
*/
#define wxVSCROLL 0x80000000
#define wxHSCROLL 0x40000000
#define wxCAPTION 0x20000000
// New styles
#define wxDOUBLE_BORDER 0x10000000
#define wxSUNKEN_BORDER 0x08000000
#define wxRAISED_BORDER 0x04000000
#define wxBORDER 0x02000000
#define wxSIMPLE_BORDER 0x02000000
#define wxSTATIC_BORDER 0x01000000
#define wxTRANSPARENT_WINDOW 0x00100000
#define wxNO_BORDER 0x00200000
#define wxUSER_COLOURS 0x00800000
// Override CTL3D etc. control colour processing to
// allow own background colour
// OBSOLETE - use wxNO_CTL3D instead
#define wxNO_3D 0x00800000
// Override CTL3D or native 3D styles for children
#define wxOVERRIDE_KEY_TRANSLATIONS 0x00400000
// TODO: do we need this??? (Motif only)
// Add this style to a panel to get tab traversal working
// outside of dialogs.
#define wxTAB_TRAVERSAL 0x00080000
// Orientations
#define wxHORIZONTAL 0x01
#define wxVERTICAL 0x02
#define wxBOTH (wxVERTICAL|wxHORIZONTAL)
#define wxCENTER_FRAME 0x04 /* centering into frame rather than screen */
/*
* Frame/dialog style flags
*/
#define wxSTAY_ON_TOP 0x8000
#define wxICONIZE 0x4000
#define wxMINIMIZE wxICONIZE
#define wxMAXIMIZE 0x2000
#define wxTHICK_FRAME 0x1000
#define wxSYSTEM_MENU 0x0800
#define wxMINIMIZE_BOX 0x0400
#define wxMAXIMIZE_BOX 0x0200
#define wxTINY_CAPTION_HORIZ 0x0100
#define wxTINY_CAPTION_VERT 0x0080
#define wxRESIZE_BOX wxMAXIMIZE_BOX
#define wxRESIZE_BORDER 0x0040
#define wxDIALOG_MODAL 0x0020
#define wxDIALOG_MODELESS 0x0000
#define wxDEFAULT_FRAME_STYLE (wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION)
#if WXWIN_COMPATIBILITY
#define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE
#endif
#define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME)
/*
* Subwindow style flags
*/
#define wxRETAINED 0x0001
#define wxBACKINGSTORE wxRETAINED
// wxCanvas or wxPanel can optionally have a thick frame under MS Windows.
// #define wxTHICK_FRAME 0x1000
/*
* wxToolBar style flags
*/
#define wxTB_3DBUTTONS 0x8000
/*
* Apply to all panel items
*/
#define wxCOLOURED 0x0800
// Alignment for panel item labels: replaces characters with zeros
// when creating label, so spaces can be included in string for alignment.
#define wxFIXED_LENGTH 0x0400
#define wxALIGN_LEFT 0x0000
#define wxALIGN_CENTER 0x0100
#define wxALIGN_CENTRE 0x0100
#define wxALIGN_RIGHT 0x0200
/*
* Styles for wxListBox
*/
// In wxListBox style flag
#define wxSB_MASK 0x0008
#define wxNEEDED_SB 0x0000
#define wxALWAYS_SB 0x0008
// New naming convention
#define wxLB_NEEDED_SB wxNEEDED_SB
#define wxLB_ALWAYS_SB wxALWAYS_SB
#define wxLB_SORT 0x0010
// These duplicate the styles in the Multiple argument
#define wxLB_SINGLE 0x0000
#define wxLB_MULTIPLE 0x0040
#define wxLB_EXTENDED 0x0080
// wxLB_OWNERDRAW is Windows-only
#define wxLB_OWNERDRAW 0x0100
#define wxLB_HSCROLL wxHSCROLL
/*
* wxTextCtrl style flags
*/
#define wxPROCESS_ENTER 0x0004
#define wxPASSWORD 0x0008
#define wxTE_PROCESS_ENTER wxPROCESS_ENTER
#define wxTE_PASSWORD wxPASSWORD
#define wxTE_READONLY 0x0010
#define wxTE_MULTILINE 0x0020
// TODO For backward compatibility, need wxOLD_READONLY
#define wxREADONLY wxTE_READONLY
#define wxEDITABLE 0
// #define wxTE_RICHTEXT 0x0020
/*
* wxComboBox style flags
*/
#define wxCB_SIMPLE 0x0004
#define wxCB_DROPDOWN 0x0000
#define wxCB_SORT 0x0008
#define wxCB_READONLY wxREADONLY
/*
* wxRadioBox/wxRadioButton style flags
*/
#define wxRA_HORIZONTAL wxHORIZONTAL
#define wxRA_VERTICAL wxVERTICAL
#define wxRB_GROUP 0x0004
/*
* wxGauge flags
*/
#define wxGA_PROGRESSBAR 0x0004
#define wxGA_HORIZONTAL wxHORIZONTAL
#define wxGA_VERTICAL wxVERTICAL
/*
* wxSlider flags
*/
#define wxSL_HORIZONTAL wxHORIZONTAL
#define wxSL_VERTICAL wxVERTICAL
// The next one is obsolete - use scroll events instead
#define wxSL_NOTIFY_DRAG 0x0000
#define wxSL_AUTOTICKS 0x0008
// #define wxSL_MANUALTICKS 0x0010
#define wxSL_LABELS 0x0020
#define wxSL_LEFT 0x0040
#define wxSL_TOP 0x0080
#define wxSL_RIGHT 0x0100
#define wxSL_BOTTOM 0x0200
#define wxSL_BOTH 0x0400
#define wxSL_SELRANGE 0x0800
/*
* wxScrollBar flags
*/
#define wxSB_HORIZONTAL wxHORIZONTAL
#define wxSB_VERTICAL wxVERTICAL
/*
* wxButton flags
*/
#define wxBU_AUTODRAW 0x0004
#define wxBU_NOAUTODRAW 0x0000
/*
* wxTreeCtrl flags
*/
#define wxTR_HAS_BUTTONS 0x0004
#define wxTR_EDIT_LABELS 0x0008
/*
* 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
#define wxLC_USER_TEXT 0x0200
#define wxLC_EDIT_LABELS 0x0400
#define wxLC_NO_HEADER 0x0800
#define wxLC_NO_SORT_HEADER 0x1000
#define wxLC_SINGLE_SEL 0x2000
#define wxLC_SORT_ASCENDING 0x4000
#define wxLC_SORT_DESCENDING 0x8000
#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
/*
* wxSpinButton flags
*/
#define wxSP_VERTICAL 0x0004
#define wxSP_HORIZONTAL 0x0008
#define wxSP_ARROW_KEYS 0x0010
#define wxSP_WRAP 0x0020
/*
* wxSplitterWnd flags
*/
#define wxSP_NOBORDER 0x0000
#define wxSP_3D 0x0004
#define wxSP_BORDER 0x0008
/*
* wxTabCtrl flags
*/
#define wxTAB_MULTILINE 0x0000
#define wxTAB_RIGHTJUSTIFY 0x0004
#define wxTAB_FIXEDWIDTH 0x0008
#define wxTAB_OWNERDRAW 0x0010
/*
* wxStatusBar95 flags
*/
#define wxSB_SIZEGRIP 0x0002
/*
* GDI descriptions
*/
enum {
// Text font families
wxDEFAULT = 70,
wxDECORATIVE,
wxROMAN,
wxSCRIPT,
wxSWISS,
wxMODERN,
wxTELETYPE, /* @@@@ */
// Proportional or Fixed width fonts (not yet used)
wxVARIABLE = 80,
wxFIXED,
wxNORMAL = 90,
wxLIGHT,
wxBOLD,
// Also wxNORMAL for normal (non-italic text)
wxITALIC,
wxSLANT,
// Pen styles
wxSOLID = 100,
wxDOT,
wxLONG_DASH,
wxSHORT_DASH,
wxDOT_DASH,
wxUSER_DASH,
wxTRANSPARENT,
// Brush & Pen Stippling. Note that a stippled pen cannot be dashed!!
// Note also that stippling a Pen IS meaningfull, because a Line is
// drawn with a Pen, and without any Brush -- and it can be stippled.
wxSTIPPLE = 110,
wxBDIAGONAL_HATCH,
wxCROSSDIAG_HATCH,
wxFDIAGONAL_HATCH,
wxCROSS_HATCH,
wxHORIZONTAL_HATCH,
wxVERTICAL_HATCH,
#define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
wxJOIN_BEVEL = 120,
wxJOIN_MITER,
wxJOIN_ROUND,
wxCAP_ROUND = 130,
wxCAP_PROJECTING,
wxCAP_BUTT
};
// Logical ops
typedef enum {
wxCLEAR, // 0
wxXOR, // src XOR dst
wxINVERT, // NOT dst
wxOR_REVERSE, // src OR (NOT dst)
wxAND_REVERSE,// src AND (NOT dst)
wxCOPY, // src
wxAND, // src AND dst
wxAND_INVERT, // (NOT src) AND dst
wxNO_OP, // dst
wxNOR, // (NOT src) AND (NOT dst)
wxEQUIV, // (NOT src) XOR dst
wxSRC_INVERT, // (NOT src)
wxOR_INVERT, // (NOT src) OR dst
wxNAND, // (NOT src) OR (NOT dst)
wxOR, // src OR dst
wxSET, // 1
wxSRC_OR, // source _bitmap_ OR destination
wxSRC_AND // source _bitmap_ AND destination
} form_ops_t;
// Flood styles
#define wxFLOOD_SURFACE 1
#define wxFLOOD_BORDER 2
// Polygon filling mode
#define wxODDEVEN_RULE 1
#define wxWINDING_RULE 2
// ToolPanel in wxFrame
#define wxTOOL_TOP 1
#define wxTOOL_BOTTOM 2
#define wxTOOL_LEFT 3
#define wxTOOL_RIGHT 4
// Dialog specifiers/return values
#define wxOK 0x0001
#define wxYES_NO 0x0002
#define wxCANCEL 0x0004
#define wxYES 0x0008
#define wxNO 0x0010
#define wxICON_EXCLAMATION 0x0020
#define wxICON_HAND 0x0040
#define wxICON_QUESTION 0x0080
#define wxICON_INFORMATION 0x0100
#define wxICON_STOP wxICON_HAND
#define wxICON_ASTERISK wxICON_INFORMATION
#define wxICON_MASK (0x0020|0x0040|0x0080|0x0100)
#define wxCENTRE 0x0200
#define wxCENTER wxCENTRE
// Possible SetSize flags
// Use internally-calculated width if -1
#define wxSIZE_AUTO_WIDTH 1
// Use internally-calculated height if -1
#define wxSIZE_AUTO_HEIGHT 2
// Use internally-calculated width and height if each is -1
#define wxSIZE_AUTO 3
// Ignore missing (-1) dimensions (use existing).
// For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code.
#define wxSIZE_USE_EXISTING 0
// Allow -1 as a valid position
#define wxSIZE_ALLOW_MINUS_ONE 4
// Clipboard formats
// Numbers as per winuser.h
# define wxCF_TEXT 1 /* CF_TEXT */
# define wxCF_BITMAP 2 /* CF_BITMAP */
# define wxCF_METAFILE 3 /* CF_METAFILEPICT */
# define wxCF_DIB 8 /* CF_DIB */
# define wxCF_OEMTEXT 7 /* CF_OEMTEXT */
// Virtual keycodes
enum _Virtual_keycodes {
WXK_BACK = 8,
WXK_TAB = 9,
WXK_RETURN = 13,
WXK_ESCAPE = 27,
WXK_SPACE = 32,
WXK_DELETE = 127,
WXK_START = 300,
WXK_LBUTTON,
WXK_RBUTTON,
WXK_CANCEL,
WXK_MBUTTON,
WXK_CLEAR,
WXK_SHIFT,
WXK_CONTROL,
WXK_MENU,
WXK_PAUSE,
WXK_CAPITAL,
WXK_PRIOR, // Page up
WXK_NEXT, // Page down
WXK_END,
WXK_HOME,
WXK_LEFT,
WXK_UP,
WXK_RIGHT,
WXK_DOWN,
WXK_SELECT,
WXK_PRINT,
WXK_EXECUTE,
WXK_SNAPSHOT,
WXK_INSERT,
WXK_HELP,
WXK_NUMPAD0,
WXK_NUMPAD1,
WXK_NUMPAD2,
WXK_NUMPAD3,
WXK_NUMPAD4,
WXK_NUMPAD5,
WXK_NUMPAD6,
WXK_NUMPAD7,
WXK_NUMPAD8,
WXK_NUMPAD9,
WXK_MULTIPLY,
WXK_ADD,
WXK_SEPARATOR,
WXK_SUBTRACT,
WXK_DECIMAL,
WXK_DIVIDE,
WXK_F1,
WXK_F2,
WXK_F3,
WXK_F4,
WXK_F5,
WXK_F6,
WXK_F7,
WXK_F8,
WXK_F9,
WXK_F10,
WXK_F11,
WXK_F12,
WXK_F13,
WXK_F14,
WXK_F15,
WXK_F16,
WXK_F17,
WXK_F18,
WXK_F19,
WXK_F20,
WXK_F21,
WXK_F22,
WXK_F23,
WXK_F24,
WXK_NUMLOCK,
WXK_SCROLL,
WXK_PAGEUP,
WXK_PAGEDOWN
};
// Colours - see wx_gdi.cc for database
// OS mnemonics -- Identify the running OS (useful for Windows)
// [Not all platforms are currently available or supported]
enum {
wxCURSES,
wxXVIEW_X, // Sun's XView OpenLOOK toolkit
wxMOTIF_X, // OSF Motif 1.x.x
wxCOSE_X, // OSF Common Desktop Environment
wxNEXTSTEP, // NeXTStep
wxMACINTOSH, // Apple System 7
wxGEOS, // GEOS
wxOS2_PM, // OS/2 Workplace
wxWINDOWS, // Windows or WfW
wxPENWINDOWS, // Windows for Pen Computing
wxWINDOWS_NT, // Windows NT
wxWIN32S, // Windows 32S API
wxWIN95, // Windows 95
wxWIN386 // Watcom 32-bit supervisor modus
};
// Printing
#ifndef wxPORTRAIT
#define wxPORTRAIT 1
#define wxLANDSCAPE 2
#endif
// Standard menu identifiers
#define wxID_OPEN 5000
#define wxID_CLOSE 5001
#define wxID_NEW 5002
#define wxID_SAVE 5003
#define wxID_SAVEAS 5004
#define wxID_REVERT 5005
#define wxID_EXIT 5006
#define wxID_UNDO 5007
#define wxID_REDO 5008
#define wxID_HELP 5009
#define wxID_PRINT 5010
#define wxID_PRINT_SETUP 5011
#define wxID_PREVIEW 5012
#define wxID_ABOUT 5013
#define wxID_HELP_CONTENTS 5014
#define wxID_HELP_COMMANDS 5015
#define wxID_HELP_PROCEDURES 5016
#define wxID_HELP_CONTEXT 5017
#define wxID_CUT 5030
#define wxID_COPY 5031
#define wxID_PASTE 5032
#define wxID_CLEAR 5033
#define wxID_FIND 5034
#define wxID_FILE1 5050
#define wxID_FILE2 5051
#define wxID_FILE3 5052
#define wxID_FILE4 5053
#define wxID_FILE5 5054
#define wxID_FILE6 5055
#define wxID_FILE7 5056
#define wxID_FILE8 5057
#define wxID_FILE9 5058
#define wxID_OK 5100
#define wxID_CANCEL 5101
#define wxID_APPLY 5102
#define wxID_YES 5103
#define wxID_NO 5104
#ifdef __WINDOWS__
// Stand-ins for Windows types, to avoid
// #including all of windows.h
typedef unsigned long WXHWND;
typedef unsigned long WXHANDLE;
typedef unsigned long WXHICON;
typedef unsigned long WXHFONT;
typedef unsigned long WXHMENU;
typedef unsigned long WXHPEN;
typedef unsigned long WXHBRUSH;
typedef unsigned long WXHPALETTE;
typedef unsigned long WXHCURSOR;
typedef unsigned long WXHRGN;
typedef unsigned long WXHINSTANCE;
typedef unsigned long WXHBITMAP;
typedef unsigned long WXHIMAGELIST;
typedef unsigned long WXHGLOBAL;
typedef unsigned long WXHDC;
typedef unsigned int WXUINT;
typedef unsigned long WXDWORD;
typedef unsigned short WXWORD;
typedef unsigned int WXWPARAM;
typedef long WXLPARAM;
typedef unsigned long WXCOLORREF;
typedef void * WXRGN;
typedef void * WXRGNDATA;
typedef void * WXMSG;
typedef unsigned long WXHCONV;
typedef void * WXDRAWITEMSTRUCT;
typedef void * WXMEASUREITEMSTRUCT;
typedef void * WXLPCREATESTRUCT;
typedef int (*WXFARPROC)();
#endif
#endif
// __WXDEFSH__

13
include/wx/dialog.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __DIALOGH_BASE__
#define __DIALOGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dialog.h"
#elif defined(__MOTIF__)
#include "wx/xt/dialog.h"
#elif defined(__GTK__)
#include "wx/gtk/dialog.h"
#endif
#endif
// __DIALOGH_BASE__

13
include/wx/dirdlg.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __DIRDLGH_BASE__
#define __DIRDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/dirdlg.h"
#elif defined(__MOTIF__)
#include "wx/xt/dirdlg.h"
#elif defined(__GTK__)
#include "wx/gtk/dirdlg.h"
#endif
#endif
// __DIRDLGH_BASE__

11
include/wx/dnd.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef __DNDH_BASE__
#define __DNDH_BASE__
#if defined(__WINDOWS__)
#elif defined(__MOTIF__)
#elif defined(__GTK__)
#include "wx/gtk/dnd.h"
#endif
#endif
// __DNDH_BASE__

519
include/wx/docview.h Normal file
View File

@@ -0,0 +1,519 @@
/////////////////////////////////////////////////////////////////////////////
// Name: docview.h
// Purpose: Doc/View classes
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __DOCH__
#define __DOCH__
#ifdef __GNUG__
#pragma interface "docview.h"
#endif
#include "wx/defs.h"
#include "wx/list.h"
#include "wx/cmndata.h"
#include "wx/string.h"
#if USE_PRINTING_ARCHITECTURE
#include "wx/print.h"
#endif
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxDocument;
class WXDLLEXPORT wxView;
class WXDLLEXPORT wxDocTemplate;
class WXDLLEXPORT wxDocManager;
class WXDLLEXPORT wxPrintInfo;
class WXDLLEXPORT wxCommand;
class WXDLLEXPORT wxCommandProcessor;
class WXDLLEXPORT wxFileHistory;
class WXDLLIMPORT ostream;
class WXDLLIMPORT istream;
// Document manager flags
#define wxDOC_SDI 1
#define wxDOC_MDI 2
#define wxDOC_NEW 4
#define wxDOC_SILENT 8
#define wxDEFAULT_DOCMAN_FLAGS wxDOC_SDI
// Document template flags
#define wxTEMPLATE_VISIBLE 1
#define wxTEMPLATE_INVISIBLE 2
#define wxDEFAULT_TEMPLATE_FLAGS wxTEMPLATE_VISIBLE
#define wxMAX_FILE_HISTORY 9
class WXDLLEXPORT wxDocument : public wxEvtHandler
{
DECLARE_ABSTRACT_CLASS(wxDocument)
public:
wxDocument(wxDocument *parent = NULL);
~wxDocument(void);
void SetFilename(const wxString& filename, bool notifyViews = FALSE);
inline wxString GetFilename(void) const { return m_documentFile; }
inline void SetTitle(const wxString& title) { m_documentTitle = title; };
inline wxString GetTitle(void) const { return m_documentTitle; }
inline void SetDocumentName(const wxString& name) { m_documentTypeName = name; };
inline wxString GetDocumentName(void) const { return m_documentTypeName; }
// Has the document been saved yet?
inline bool GetDocumentSaved(void) { return m_savedYet; }
inline void SetDocumentSaved(bool saved = TRUE) { m_savedYet = saved; }
virtual bool Close(void);
virtual bool Save(void);
virtual bool SaveAs(void);
virtual bool Revert(void);
virtual ostream& SaveObject(ostream& stream);
virtual istream& LoadObject(istream& stream);
// Called by wxWindows
virtual bool OnSaveDocument(const wxString& filename);
virtual bool OnOpenDocument(const wxString& filename);
virtual bool OnNewDocument(void);
virtual bool OnCloseDocument(void);
// Prompts for saving if about to close a modified document.
// Returns TRUE if ok to close the document (may have saved in the
// meantime, or set modified to FALSE)
virtual bool OnSaveModified(void);
// Called by framework if created automatically by the
// default document manager: gives document a chance to
// initialise and (usually) create a view
virtual bool OnCreate(const wxString& path, long flags);
// By default, creates a base wxCommandProcessor.
virtual wxCommandProcessor *OnCreateCommandProcessor(void);
virtual inline wxCommandProcessor *GetCommandProcessor(void) const { return m_commandProcessor; }
virtual inline void SetCommandProcessor(wxCommandProcessor *proc) { m_commandProcessor = proc; }
// Called after a view is added or removed.
// The default implementation deletes the document if this
// is there are no more views.
virtual void OnChangedViewList(void);
virtual bool DeleteContents(void);
virtual bool Draw(wxDC&);
virtual inline bool IsModified(void) const { return m_documentModified; }
virtual inline void Modify(bool mod) { m_documentModified = mod; }
virtual bool AddView(wxView *view);
virtual bool RemoveView(wxView *view);
inline wxList& GetViews(void) const { return (wxList&) m_documentViews; }
wxView *GetFirstView(void) const;
virtual void UpdateAllViews(wxView *sender = NULL, wxObject *hint = NULL);
// Remove all views (because we're closing the document)
virtual bool DeleteAllViews(void);
// Other stuff
virtual wxDocManager *GetDocumentManager(void) const;
virtual inline wxDocTemplate *GetDocumentTemplate(void) const { return m_documentTemplate; }
virtual inline void SetDocumentTemplate(wxDocTemplate *temp) { m_documentTemplate = temp; }
// Get title, or filename if no title, else [unnamed]
virtual bool GetPrintableName(wxString& buf) const;
// Returns a window that can be used as a parent for document-related
// dialogs. Override if necessary.
virtual wxWindow *GetDocumentWindow(void) const;
protected:
wxList m_documentViews;
wxString m_documentFile;
wxString m_documentTitle;
wxString m_documentTypeName;
wxDocTemplate* m_documentTemplate;
bool m_documentModified;
wxDocument* m_documentParent;
wxCommandProcessor* m_commandProcessor;
bool m_savedYet;
};
class WXDLLEXPORT wxView: public wxEvtHandler
{
DECLARE_ABSTRACT_CLASS(wxView)
public:
wxView(wxDocument *doc = NULL);
~wxView(void);
inline wxDocument *GetDocument(void) const { return m_viewDocument; }
void SetDocument(wxDocument *doc);
inline wxString GetViewName(void) const { return m_viewTypeName; }
void SetViewName(const wxString& name) { m_viewTypeName = name; };
inline wxFrame *GetFrame(void) const { return m_viewFrame ; }
inline void SetFrame(wxFrame *frame) { m_viewFrame = frame; }
virtual void OnActivateView(bool activate, wxView *activeView, wxView *deactiveView);
virtual void OnDraw(wxDC *dc) = 0;
virtual void OnPrint(wxDC *dc, wxObject *info);
virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
virtual void OnChangeFilename(void);
// Called by framework if created automatically by the
// default document manager class: gives view a chance to
// initialise
virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return TRUE; };
// Checks if the view is the last one for the document; if so,
// asks user to confirm save data (if modified). If ok,
// deletes itself and returns TRUE.
virtual bool Close(bool deleteWindow = TRUE);
// Override to do cleanup/veto close
virtual bool OnClose(bool deleteWindow);
// Defeat compiler warning
inline bool OnClose(void) { return wxEvtHandler::OnClose(); }
// Extend event processing to search the document's event table
virtual bool ProcessEvent(wxEvent& event);
// A view's window can call this to notify the view it is (in)active.
// The function then notifies the document manager.
virtual void Activate(bool activate);
inline wxDocManager *GetDocumentManager(void) const { return m_viewDocument->GetDocumentManager(); }
#if USE_PRINTING_ARCHITECTURE
virtual wxPrintout *OnCreatePrintout(void);
#endif
protected:
wxDocument* m_viewDocument;
wxString m_viewTypeName;
wxFrame* m_viewFrame;
};
// Represents user interface (and other) properties of documents and views
class WXDLLEXPORT wxDocTemplate: public wxObject
{
DECLARE_CLASS(wxDocTemplate)
friend class WXDLLEXPORT wxDocManager;
public:
// Associate document and view types.
// They're for identifying what view is associated with what
// template/document type
wxDocTemplate(wxDocManager *manager, const wxString& descr, const wxString& filter, const wxString& dir,
const wxString& ext, const wxString& docTypeName, const wxString& viewTypeName,
wxClassInfo *docClassInfo = NULL, wxClassInfo *viewClassInfo = NULL,
long flags = wxDEFAULT_TEMPLATE_FLAGS);
~wxDocTemplate(void);
// By default, these two member functions dynamically creates document
// and view using dynamic instance construction.
// Override these if you need a different method of construction.
virtual wxDocument *CreateDocument(const wxString& path, long flags = 0);
virtual wxView *CreateView(wxDocument *doc, long flags = 0);
inline wxString GetDefaultExtension(void) const { return m_defaultExt; };
inline wxString GetDescription(void) const { return m_description; }
inline wxString GetDirectory(void) const { return m_directory; };
inline wxDocManager *GetDocumentManager(void) const { return m_documentManager; }
inline void SetDocumentManager(wxDocManager *manager) { m_documentManager = manager; }
inline wxString GetFileFilter(void) const { return m_fileFilter; };
inline long GetFlags(void) const { return m_flags; };
virtual wxString GetViewName(void) const { return m_viewTypeName; }
virtual wxString GetDocumentName(void) const { return m_docTypeName; }
inline void SetFileFilter(const wxString& filter) { m_fileFilter = filter; };
inline void SetDirectory(const wxString& dir) { m_directory = dir; };
inline void SetDescription(const wxString& descr) { m_description = descr; };
inline void SetDefaultExtension(const wxString& ext) { m_defaultExt = ext; };
inline void SetFlags(long flags) { m_flags = flags; };
inline bool IsVisible(void) const { return ((m_flags & wxTEMPLATE_VISIBLE) == wxTEMPLATE_VISIBLE); }
protected:
long m_flags;
wxString m_fileFilter;
wxString m_directory;
wxString m_description;
wxString m_defaultExt;
wxString m_docTypeName;
wxString m_viewTypeName;
wxDocManager* m_documentManager;
// For dynamic creation of appropriate instances.
wxClassInfo* m_docClassInfo;
wxClassInfo* m_viewClassInfo;
};
// One object of this class may be created in an application,
// to manage all the templates and documents.
class WXDLLEXPORT wxDocManager: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxDocManager)
public:
wxDocManager(long flags = wxDEFAULT_DOCMAN_FLAGS, bool initialize = TRUE);
~wxDocManager(void);
virtual bool Initialize(void);
// Handlers for common user commands
// virtual void OldOnMenuCommand(int command);
void OnFileClose(wxCommandEvent& event);
void OnFileNew(wxCommandEvent& event);
void OnFileOpen(wxCommandEvent& event);
void OnFileRevert(wxCommandEvent& event);
void OnFileSave(wxCommandEvent& event);
void OnFileSaveAs(wxCommandEvent& event);
void OnPrint(wxCommandEvent& event);
void OnPrintSetup(wxCommandEvent& event);
void OnPreview(wxCommandEvent& event);
void OnUndo(wxCommandEvent& event);
void OnRedo(wxCommandEvent& event);
#ifdef WXWIN_COMPATIBILITY
virtual wxDocument *CreateDocument(char *WXUNUSED(path), long WXUNUSED(flags = 0)) { return NULL; };
#endif
virtual wxDocument *CreateDocument(const wxString& path, long flags = 0);
virtual wxView *CreateView(wxDocument *doc, long flags = 0);
virtual void DeleteTemplate(wxDocTemplate *temp, long flags = 0);
virtual bool FlushDoc(wxDocument *doc);
virtual wxDocTemplate *MatchTemplate(const wxString& path);
virtual wxDocTemplate *SelectDocumentPath(wxDocTemplate **templates,
int noTemplates, wxString& path, long flags, bool save = FALSE);
virtual wxDocTemplate *SelectDocumentType(wxDocTemplate **templates,
int noTemplates);
virtual wxDocTemplate *SelectViewType(wxDocTemplate **templates,
int noTemplates);
virtual wxDocTemplate *FindTemplateForPath(const wxString& path);
void AssociateTemplate(wxDocTemplate *temp);
void DisassociateTemplate(wxDocTemplate *temp);
wxDocument *GetCurrentDocument(void) const;
inline void SetMaxDocsOpen(int n) { m_maxDocsOpen = n; }
inline int GetMaxDocsOpen(void) const { return m_maxDocsOpen; }
// Add and remove a document from the manager's list
void AddDocument(wxDocument *doc);
void RemoveDocument(wxDocument *doc);
// Clear remaining documents and templates
bool Clear(bool force = TRUE);
// Views or windows should inform the document manager
// when a view is going in or out of focus
virtual void ActivateView(wxView *view, bool activate = TRUE, bool deleting = FALSE);
virtual inline wxView *GetCurrentView(void) const { return m_currentView; }
virtual inline wxList& GetDocuments(void) const { return (wxList&) m_docs; }
// Make a default document name
virtual bool MakeDefaultName(wxString& buf);
virtual wxFileHistory *OnCreateFileHistory(void);
virtual inline wxFileHistory *GetFileHistory(void) const { return m_fileHistory; }
// File history management
virtual void AddFileToHistory(const wxString& file);
virtual int GetNoHistoryFiles(void) const;
virtual wxString GetHistoryFile(int i) const;
virtual void FileHistoryUseMenu(wxMenu *menu);
virtual void FileHistoryLoad(const wxString& resourceFile, const wxString& section);
virtual void FileHistorySave(const wxString& resourceFile, const wxString& section);
protected:
long m_flags;
int m_defaultDocumentNameCounter;
int m_maxDocsOpen;
wxList m_docs;
wxList m_templates;
wxView* m_currentView;
wxFileHistory* m_fileHistory;
DECLARE_EVENT_TABLE()
};
/*
* A default child frame
*/
class WXDLLEXPORT wxDocChildFrame: public wxFrame
{
DECLARE_CLASS(wxDocChildFrame)
public:
wxDocChildFrame(wxDocument *doc, wxView *view, wxFrame *frame, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long type = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
~wxDocChildFrame(void);
bool OnClose(void);
// Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event);
// void OldOnMenuCommand(int id);
void OnActivate(wxActivateEvent& event);
inline wxDocument *GetDocument(void) const { return m_childDocument; }
inline wxView *GetView(void) const { return m_childView; }
inline void SetDocument(wxDocument *doc) { m_childDocument = doc; }
inline void SetView(wxView *view) { m_childView = view; }
protected:
wxDocument* m_childDocument;
wxView* m_childView;
DECLARE_EVENT_TABLE()
};
/*
* A default parent frame
*/
class WXDLLEXPORT wxDocParentFrame: public wxFrame
{
DECLARE_CLASS(wxDocParentFrame)
public:
wxDocParentFrame(wxDocManager *manager, wxFrame *frame, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long type = wxDEFAULT_FRAME, const wxString& name = "frame");
bool OnClose(void);
// Extend event processing to search the document manager's event table
virtual bool ProcessEvent(wxEvent& event);
// void OldOnMenuCommand(int id);
wxDocManager *GetDocumentManager(void) const { return m_docManager; }
void OnExit(wxCommandEvent& event);
void OnMRUFile(wxCommandEvent& event);
protected:
wxDocManager *m_docManager;
DECLARE_EVENT_TABLE()
};
/*
* Provide simple default printing facilities
*/
#if USE_PRINTING_ARCHITECTURE
class WXDLLEXPORT wxDocPrintout: public wxPrintout
{
DECLARE_DYNAMIC_CLASS(wxDocPrintout)
public:
wxDocPrintout(wxView *view = NULL, const wxString& title = "Printout");
bool OnPrintPage(int page);
bool HasPage(int page);
bool OnBeginDocument(int startPage, int endPage);
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo);
virtual inline wxView *GetView(void) { return m_printoutView; }
protected:
wxView* m_printoutView;
};
#endif
/*
* Command processing framework
*/
class WXDLLEXPORT wxCommand: public wxObject
{
DECLARE_CLASS(wxCommand)
public:
wxCommand(bool canUndoIt = FALSE, const wxString& name = "");
~wxCommand(void);
// Override this to perform a command
virtual bool Do(void) = 0;
// Override this to undo a command
virtual bool Undo(void) = 0;
virtual inline bool CanUndo(void) const { return m_canUndo; }
virtual inline wxString GetName(void) const { return m_commandName; }
protected:
bool m_canUndo;
wxString m_commandName;
};
class WXDLLEXPORT wxCommandProcessor: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxCommandProcessor)
public:
wxCommandProcessor(int maxCommands = 100);
~wxCommandProcessor(void);
// Pass a command to the processor. The processor calls Do();
// if successful, is appended to the command history unless
// storeIt is FALSE.
virtual bool Submit(wxCommand *command, bool storeIt = TRUE);
virtual bool Undo(void);
virtual bool Redo(void);
virtual bool CanUndo(void);
// Call this to manage an edit menu.
inline void SetEditMenu(wxMenu *menu) { m_commandEditMenu = menu; }
inline wxMenu *GetEditMenu(void) const { return m_commandEditMenu; }
virtual void SetMenuStrings(void);
virtual void Initialize(void);
inline wxList& GetCommands(void) const { return (wxList&) m_commands; }
inline int GetMaxCommands(void) const { return m_maxNoCommands; }
virtual void ClearCommands(void);
protected:
int m_maxNoCommands;
wxList m_commands;
wxNode* m_currentCommand;
wxMenu* m_commandEditMenu;
};
class WXDLLEXPORT wxFileHistory: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFileHistory)
public:
wxFileHistory(int maxFiles = 9);
~wxFileHistory(void);
// File history management
virtual void AddFileToHistory(const wxString& file);
inline virtual int GetNoHistoryFiles(void) const { return m_fileHistoryN; }
virtual wxString GetHistoryFile(int i) const;
virtual int GetMaxFiles(void) const { return m_fileMaxFiles; }
virtual void FileHistoryUseMenu(wxMenu *menu);
virtual void FileHistoryLoad(const wxString& resourceFile, const wxString& section);
virtual void FileHistorySave(const wxString& resourceFile, const wxString& section);
protected:
// Last n files
char** m_fileHistory;
// Number of files saved
int m_fileHistoryN;
// Menu to maintain
wxMenu* m_fileMenu;
// Max files to maintain
int m_fileMaxFiles;
};
// For compatibility with existing file formats:
// converts from/to a stream to/from a temporary file.
bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, ostream& stream);
bool WXDLLEXPORT wxTransferStreamToFile(istream& stream, const wxString& filename);
#endif

338
include/wx/dynarray.h Normal file
View File

@@ -0,0 +1,338 @@
///////////////////////////////////////////////////////////////////////////////
// Name: dynarray.h
// Purpose: auto-resizable (i.e. dynamic) array support
// Author: Vadim Zeitlin
// Modified by:
// Created: 12.09.97
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _DYNARRAY_H
#define _DYNARRAY_H
#ifdef __GNUG__
#pragma interface "dynarray.h"
#endif
#include "wx/defs.h"
#include "wx/utils.h"
typedef bool Bool;
/** @name Dynamic arrays and lists
@memo Arrays which grow on demand and do range checking (only in debug)
*/
//@{
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
/**
the initial size by which an array/list grows when an element is added
default value avoids allocate one or two bytes when the array is created
which is rather inefficient
*/
#define WX_ARRAY_DEFAULT_INITIAL_SIZE (16)
// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
/**
callback compare function for quick sort
must return -1, 0 or +1 if pItem1 <, = or > pItem2
*/
#ifdef __VISUALC__
#define CMPFUNC_CONV _cdecl
#else // !Visual C++
#define CMPFUNC_CONV
#endif // compiler
typedef int (CMPFUNC_CONV *CMPFUNC)(const void* pItem1, const void* pItem2);
// ----------------------------------------------------------------------------
/**
base class managing data having size of type 'long' (not used directly)
NB: for efficiency this often used class has no virtual functions (hence no
VTBL), even dtor is <B>not</B> virtual. If used as expected it won't
create any problems because ARRAYs from DEFINE_ARRAY have no dtor at all,
so it's not too important if it's not called (this happens when you cast
"SomeArray *" as "BaseArray *" and then delete it)
@memo Base class for template array and list classes
*/
// ----------------------------------------------------------------------------
class wxBaseArray
{
public:
/** @name ctors and dtor */
//@{
/// default ctor
wxBaseArray();
/// copy ctor
wxBaseArray(const wxBaseArray& array);
/// assignment operator
wxBaseArray& operator=(const wxBaseArray& src);
/// not virtual, see above
/// EXCEPT for Gnu compiler to reduce warnings...
#ifdef __GNUG__
virtual
#endif
~wxBaseArray();
//@}
/** @name memory management */
//@{
/// empties the list, but doesn't release memory
void Empty() { m_uiCount = 0; }
/// empties the list and releases memory
void Clear();
/// preallocates memory for given number of items
void Alloc(uint uiSize);
//@}
/** @name simple accessors */
//@{
/// number of elements in the array
uint Count() const { return m_uiCount; }
/// is it empty?
Bool IsEmpty() const { return m_uiCount == 0; }
//@}
protected:
// these methods are protected because if they were public one could
// mistakenly call one of them instead of DEFINE_ARRAY's or LIST's
// type safe methods
/** @name items access */
//@{
/// get item at position uiIndex (range checking is done in debug version)
long& Item(uint uiIndex) const
{ wxASSERT( uiIndex < m_uiCount ); return m_pItems[uiIndex]; }
/// same as Item()
long& operator[](uint uiIndex) const { return Item(uiIndex); }
//@}
/** @name item management */
//@{
/**
Search the element in the array, starting from the either side
@param bFromEnd if TRUE, start from the end
@return index of the first item matched or NOT_FOUND
@see NOT_FOUND
*/
int Index (long lItem, Bool bFromEnd = FALSE) const;
/// add new element at the end
void Add (long lItem);
/// add new element at given position
void Insert(long lItem, uint uiIndex);
/// remove first item matching this value
void Remove(long lItem);
/// remove item by index
void Remove(uint uiIndex);
//@}
/// sort array elements using given compare function
void Sort(CMPFUNC fCmp);
private:
void Grow(); // makes array bigger if needed
uint m_uiSize, // current size of the array
m_uiCount; // current number of elements
long *m_pItems; // pointer to data
};
// ============================================================================
// template classes
// ============================================================================
// ----------------------------------------------------------------------------
// This macro generates a new array class. It is intended for storage of simple
// types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
//
// NB: it has only inline functions => takes no space at all
// ----------------------------------------------------------------------------
#define _WX_DEFINE_ARRAY(T, name) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \
class name : public wxBaseArray \
{ \
public: \
name() \
{ wxASSERT( sizeof(T) <= sizeof(long) ); } \
\
name& operator=(const name& src) \
{ ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \
return *this; } \
\
T& operator[](uint uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
T& Item(uint uiIndex) const \
{ return (T&)(wxBaseArray::Item(uiIndex)); } \
\
int Index(T Item, Bool bFromEnd = FALSE) const \
{ return wxBaseArray::Index((long)Item, bFromEnd); } \
\
void Add(T Item) \
{ wxBaseArray::Add((long)Item); } \
void Insert(T Item, uint uiIndex) \
{ wxBaseArray::Insert((long)Item, uiIndex) ; } \
\
void Remove(uint uiIndex) { wxBaseArray::Remove(uiIndex); } \
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK( iIndex != NOT_FOUND ); \
wxBaseArray::Remove((uint)iIndex); } \
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
}
// ----------------------------------------------------------------------------
// see WX_DECLARE_LIST and WX_DEFINE_LIST
// ----------------------------------------------------------------------------
#define _WX_DECLARE_LIST(T, name) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T** pItem1, T** pItem2); \
class name : public wxBaseArray \
{ \
public: \
name() { } \
name(const name& src); \
name& operator=(const name& src); \
\
~name(); \
\
T& operator[](uint uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
T& Item(uint uiIndex) const \
{ return *(T*)wxBaseArray::Item(uiIndex); } \
\
int Index(const T& Item, Bool bFromEnd = FALSE) const; \
\
void Add(const T& Item); \
void Add(const T* pItem) \
{ wxBaseArray::Add((long)pItem); } \
\
void Insert(const T& Item, uint uiIndex); \
void Insert(const T* pItem, uint uiIndex) \
{ wxBaseArray::Insert((long)pItem, uiIndex); } \
\
void Empty(); \
\
T* Detach(uint uiIndex) \
{ T* p = (T*)wxBaseArray::Item(uiIndex); \
wxBaseArray::Remove(uiIndex); return p; } \
void Remove(uint uiIndex); \
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
\
private: \
void DoCopy(const name& src); \
}
// ----------------------------------------------------------------------------
/** @name Macros for definition of dynamic arrays and lists
These macros are ugly (especially if you look in the sources ;-), but they
allow us to define 'template' classes without actually using templates.
<BR>
<BR>
Range checking is performed in debug build for both arrays and lists. Type
checking is done at compile-time. Warning: arrays <I>never</I> shrink, they
only grow, so loading 10 millions in an array only to delete them 2 lines
below is <I>not</I> recommended. However, it does free memory when it's
destroyed, so if you destroy array also, it's ok.
*/
// ----------------------------------------------------------------------------
//@{
/**
This macro generates a new array class. It is intended for storage of simple
types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
<BR>
NB: it has only inline functions => takes no space at all
<BR>
@memo declare and define array class 'name' containing elements of type 'T'
*/
#define WX_DEFINE_ARRAY(T, name) typedef T _A##name; \
_WX_DEFINE_ARRAY(_A##name, name)
/**
This macro generates a new list class which owns the objects it contains,
i.e. it will delete them when it is destroyed. An element is of type T*,
but arguments of type T& are taken (see below!) and T& is returned.
<BR>
Don't use this for simple types such as "int" or "long"!
You _may_ use it for "double" but it's awfully inefficient.
<BR>
<BR>
Note on Add/Insert functions:
<BR>
1) function(T*) gives the object to the list, i.e. it will delete the
object when it's removed or in the list's dtor
<BR>
2) function(T&) will create a copy of the object and work with it
<BR>
<BR>
Also:
<BR>
1) Remove() will delete the object after removing it from the list
<BR>
2) Detach() just removes the object from the list (returning pointer to it)
<BR>
<BR>
NB1: Base type T should have an accessible copy ctor if Add(T&) is used,
<BR>
NB2: Never ever cast a list to it's base type: as dtor is <B>not</B> virtual
it will provoke memory leaks
<BR>
<BR>
some functions of this class are not inline, so it takes some space to
define new class from this template.
@memo declare list class 'name' containing elements of type 'T'
*/
#define WX_DECLARE_LIST(T, name) typedef T _L##name; \
_WX_DECLARE_LIST(_L##name, name)
/**
To use a list class you must
<ll>
<li>#include "dynarray.h"
<li>DECLARE_LIST(element_type, list_class_name)
<li>#include "listimpl.cpp"
<li>DEFINE_LIST(list_class_name) // same as above!
</ll>
<BR><BR>
This is necessary because at the moment of DEFINE_LIST class element_type
must be fully defined (i.e. forward declaration is not enough), while
DECLARE_LIST may be done anywhere. The separation of two allows to break
cicrcular dependencies with classes which have member variables of list
type.
@memo define (must include listimpl.cpp!) list class 'name'
*/
#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!"
//@}
// ----------------------------------------------------------------------------
/** @name Some commonly used predefined arrays */
// # overhead if not used?
// ----------------------------------------------------------------------------
//@{
/** @name ArrayInt */
WX_DEFINE_ARRAY(int, wxArrayInt);
/** @name ArrayLong */
WX_DEFINE_ARRAY(long, wxArrayLong);
/** @name ArrayPtrVoid */
WX_DEFINE_ARRAY(void *, wxArrayPtrVoid);
//@}
//@}
#endif // _DYNARRAY_H

1199
include/wx/event.h Normal file

File diff suppressed because it is too large Load Diff

159
include/wx/file.h Normal file
View File

@@ -0,0 +1,159 @@
/////////////////////////////////////////////////////////////////////////////
// Name: file.cpp
// Purpose: wxFile - encapsulates low-level "file descriptor"
// wxTempFile - safely replace the old file
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __FILEH__
#define __FILEH__
#ifdef __GNUG__
#pragma interface "file.h"
#endif
// ----------------------------------------------------------------------------
// simple types
// ----------------------------------------------------------------------------
#include <wx/filefn.h>
// define off_t
#include <sys/types.h>
#ifdef _MSC_VER
#define off_t _off_t
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// error return value for Seek() functions
const off_t ofsInvalid = (off_t)-1;
// ----------------------------------------------------------------------------
// class wxFile: raw file IO
//
// NB: for space efficiency this class has no virtual functions, including
// dtor which is _not_ virtual, so it shouldn't be used as a base class.
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFile
{
public:
// more file constants
// -------------------
// opening mode
enum OpenMode { read, write, read_write };
// standard values for file descriptor
enum { fd_invalid = -1, fd_stdin, fd_stdout, fd_stderr };
// seek type
enum SeekMode { FromStart, FromEnd, FromCurrent };
// static functions
// ----------------
static bool Exists(const char *sz); // also checks it's a regular file
// ctors
// -----
// def ctor
wxFile() { m_fd = fd_invalid; }
// open specified file (may fail, use IsOpened())
wxFile(const char *szFileName, OpenMode mode = read);
// attach to (already opened) file
wxFile(int fd) { m_fd = fd; }
// open/close
bool Create(const char *szFileName, bool bOverwrite = FALSE);
bool Open(const char *szFileName, OpenMode mode = read);
void Attach(int fd) { Close(); m_fd = fd; }
inline void Close(); // Close is a NOP if not opened
// read/write (unbuffered)
// returns number of bytes read or ofsInvalid on error
off_t Read(void *pBuf, off_t nCount);
// returns true on success
bool Write(const void *pBuf, uint nCount);
// returns true on success
bool Write(const wxString& str) { return Write(str.c_str(), str.Len()); }
// flush data not yet written
bool Flush();
// file pointer operations (return ofsInvalid on failure)
// move ptr ofs bytes related to start/current off_t/end of file
off_t Seek(off_t ofs, SeekMode mode = FromStart);
// move ptr to ofs bytes before the end
off_t SeekEnd(off_t ofs = 0) { return Seek(ofs, FromEnd); }
// get current off_t
off_t Tell() const;
// get current file length
off_t Length() const;
// simple accessors
// is file opened?
bool IsOpened() const { return m_fd != fd_invalid; }
// is end of file reached?
bool Eof() const;
// dtor closes the file if opened
~wxFile();
private:
// copy ctor and assignment operator are private because
// it doesn't make sense to copy files this way:
// attempt to do it will provoke a compile-time error.
wxFile(const wxFile&);
wxFile& operator=(const wxFile&);
int m_fd; // file descriptor or INVALID_FD if not opened
};
// ----------------------------------------------------------------------------
// class wxTempFile: if you want to replace another file, create an instance
// of wxTempFile passing the name of the file to be replaced to the ctor. Then
// you can write to wxTempFile and call Commit() function to replace the old
// file (and close this one) or call Discard() to cancel the modification. If
// you call neither of them, dtor will call Discard().
// ----------------------------------------------------------------------------
class wxTempFile
{
public:
// ctors
// default
wxTempFile() { }
// associates the temp file with the file to be replaced and opens it
wxTempFile(const wxString& strName);
// open the temp file (strName is the name of file to be replaced)
bool Open(const wxString& strName);
// is the file opened?
bool IsOpened() const { return m_file.IsOpened(); }
// I/O (both functions return true on success, false on failure)
bool Write(const void *p, uint n) { return m_file.Write(p, n); }
bool Write(const wxString& str) { return m_file.Write(str); }
// different ways to close the file
// validate changes and delete the old file of name m_strName
bool Commit();
// discard changes
void Discard();
// dtor calls Discard() if file is still opened
~wxTempFile();
private:
wxString m_strName, // name of the file to replace in Commit()
m_strTemp; // temporary file name
wxFile m_file; // the temporary file
};
#endif
// __FILEH__

13
include/wx/filedlg.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __FILEDLGH_BASE__
#define __FILEDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/filedlg.h"
#elif defined(__MOTIF__)
#include "wx/xt/filedlg.h"
#elif defined(__GTK__)
#include "wx/gtk/filedlg.h"
#endif
#endif
// __FILEDLGH_BASE__

166
include/wx/filefn.h Normal file
View File

@@ -0,0 +1,166 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filefn.h
// Purpose: File- and directory-related functions
// Author: Julian Smart
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef __FILEFNH__
#define __FILEFNH__
#ifdef __GNUG__
#pragma interface "filefn.h"
#endif
#include "wx/list.h"
bool WXDLLEXPORT wxFileExists(const wxString& filename);
#define FileExists wxFileExists
// does the path exist? (may have or not '/' or '\\' at the end)
bool WXDLLEXPORT wxPathExists(const char *pszPathName);
#define wxDirExists wxPathExists
#define DirExists wxDirExists
bool WXDLLEXPORT wxIsAbsolutePath(const wxString& filename);
#define IsAbsolutePath wxIsAbsolutePath
// Get filename
char* WXDLLEXPORT wxFileNameFromPath(char *path);
wxString WXDLLEXPORT wxFileNameFromPath(const wxString& path);
#define FileNameFromPath wxFileNameFromPath
// Get directory
char* WXDLLEXPORT wxPathOnly(char *path);
wxString WXDLLEXPORT wxPathOnly(const wxString& path);
#define PathOnly wxPathOnly
// wxString version
wxString WXDLLEXPORT wxRealPath(const wxString& path);
void WXDLLEXPORT wxDos2UnixFilename(char *s);
#define Dos2UnixFilename wxDos2UnixFilename
void WXDLLEXPORT wxUnix2DosFilename(char *s);
#define Unix2DosFilename wxUnix2DosFilename
// Strip the extension, in situ
void WXDLLEXPORT wxStripExtension(char *buffer);
// Get a temporary filename, opening and closing the file.
char* WXDLLEXPORT wxGetTempFileName(const wxString& prefix, char *buf = NULL);
// Expand file name (~/ and ${OPENWINHOME}/ stuff)
char* WXDLLEXPORT wxExpandPath(char *dest, const char *path);
// Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib)
// and make (if under the home tree) relative to home
// [caller must copy-- volatile]
char* WXDLLEXPORT wxContractPath (const wxString& filename,
const wxString& envname = "", const wxString& user = "");
// Destructive removal of /./ and /../ stuff
char* WXDLLEXPORT wxRealPath(char *path);
// Allocate a copy of the full absolute path
char* WXDLLEXPORT wxCopyAbsolutePath(const wxString& path);
// Get first file name matching given wild card.
// Flags are reserved for future use.
#define wxFILE 1
#define wxDIR 2
char* WXDLLEXPORT wxFindFirstFile(const char *spec, int flags = wxFILE);
char* WXDLLEXPORT wxFindNextFile(void);
// Does the pattern contain wildcards?
bool WXDLLEXPORT wxIsWild(const wxString& pattern);
// Does the pattern match the text (usually a filename)?
// If dot_special is TRUE, doesn't match * against . (eliminating
// `hidden' dot files)
bool WXDLLEXPORT wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = TRUE);
// Concatenate two files to form third
bool WXDLLEXPORT wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3);
// Copy file1 to file2
bool WXDLLEXPORT wxCopyFile(const wxString& file1, const wxString& file2);
// Remove file
bool WXDLLEXPORT wxRemoveFile(const wxString& file);
// Rename file
bool WXDLLEXPORT wxRenameFile(const wxString& file1, const wxString& file2);
// Get current working directory.
// If buf is NULL, allocates space using new, else
// copies into buf.
// IMPORTANT NOTE getcwd is know not to work under some releases
// of Win32s 1.3, according to MS release notes!
char* WXDLLEXPORT wxGetWorkingDirectory(char *buf = NULL, int sz = 1000);
// Set working directory
bool WXDLLEXPORT wxSetWorkingDirectory(const wxString& d);
// Make directory
bool WXDLLEXPORT wxMkdir(const wxString& dir);
// Remove directory. Flags reserved for future use.
bool WXDLLEXPORT wxRmdir(const wxString& dir, int flags = 0);
// separators in file names
#define FILE_SEP_EXT '.'
#define FILE_SEP_DSK ':'
#define FILE_SEP_PATH_DOS '\\'
#define FILE_SEP_PATH_UNIX '/'
// separator in the path list (as in PATH environment variable)
// NB: these are strings and not characters on purpose!
#define PATH_SEP_DOS ";"
#define PATH_SEP_UNIX ":"
// platform independent versions
#ifdef __UNIX__
#define FILE_SEP_PATH FILE_SEP_PATH_UNIX
#define PATH_SEP PATH_SEP_UNIX
#else // Windows
#define FILE_SEP_PATH FILE_SEP_PATH_DOS
#define PATH_SEP PATH_SEP_DOS
#endif // Unix/Windows
// is the char a path separator?
inline bool wxIsPathSeparator(char c)
{ return c == FILE_SEP_PATH_DOS || c == FILE_SEP_PATH_UNIX; }
// does the string ends with path separator?
bool WXDLLEXPORT wxEndsWithPathSeparator(const char *pszFileName);
// find a file in a list of directories, returns false if not found
bool WXDLLEXPORT wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile);
// Path searching
class WXDLLEXPORT wxPathList: public wxStringList
{
DECLARE_DYNAMIC_CLASS(wxPathList)
public:
void AddEnvList(const wxString& envVariable); // Adds all paths in environment variable
void Add(const wxString& path);
wxString FindValidPath(const wxString& filename); // Find the first full path
// for which the file exists
wxString FindAbsoluteValidPath(const wxString& filename); // Find the first full path
// for which the file exists; ensure it's an absolute
// path that gets returned.
void EnsureFileAccessible(const wxString& path); // Given full path and filename,
// add path to list
bool Member(const wxString& path);
};
#endif
// __FILEFNH__

13
include/wx/font.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __FONTH_BASE__
#define __FONTH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/font.h"
#elif defined(__MOTIF__)
#include "wx/xt/font.h"
#elif defined(__GTK__)
#include "wx/gtk/font.h"
#endif
#endif
// __FONTH_BASE__

13
include/wx/fontdlg.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __FONTDLGH_BASE__
#define __FONTDLGH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/fontdlg.h"
#elif defined(__MOTIF__)
#include "wx/generic/fontdlgg.h"
#elif defined(__GTK__)
#include "wx/generic/fontdlgg.h"
#endif
#endif
// __FONTDLGH_BASE__

13
include/wx/frame.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __FRAMEH_BASE__
#define __FRAMEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/frame.h"
#elif defined(__MOTIF__)
#include "wx/xt/frame.h"
#elif defined(__GTK__)
#include "wx/gtk/frame.h"
#endif
#endif
// __FRAMEH_BASE__

13
include/wx/gauge.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __GAUGEH_BASE__
#define __GAUGEH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/gauge.h"
#elif defined(__MOTIF__)
#include "wx/xt/gauge.h"
#elif defined(__GTK__)
#include "wx/gtk/gauge.h"
#endif
#endif
// __GAUGEH_BASE__

335
include/wx/gdicmn.h Normal file
View File

@@ -0,0 +1,335 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gdicmn.h
// Purpose: Common GDI classes, types and declarations
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GDICMNH__
#define __GDICMNH__
#ifdef __GNUG__
#pragma interface "gdicmn.h"
#endif
#include "wx/object.h"
#include "wx/list.h"
#include "wx/hash.h"
#include "wx/setup.h"
#ifdef __WINDOWS__
#include "wx/msw/colour.h"
#elif defined(__MOTIF__)
#include "wx/xt/colour.h"
#elif defined(__GTK__)
#include "wx/gtk/colour.h"
#endif
// Standard cursors
typedef enum {
wxCURSOR_ARROW = 1,
wxCURSOR_BULLSEYE,
wxCURSOR_CHAR,
wxCURSOR_CROSS,
wxCURSOR_HAND,
wxCURSOR_IBEAM,
wxCURSOR_LEFT_BUTTON,
wxCURSOR_MAGNIFIER,
wxCURSOR_MIDDLE_BUTTON,
wxCURSOR_NO_ENTRY,
wxCURSOR_PAINT_BRUSH,
wxCURSOR_PENCIL,
wxCURSOR_POINT_LEFT,
wxCURSOR_POINT_RIGHT,
wxCURSOR_QUESTION_ARROW,
wxCURSOR_RIGHT_BUTTON,
wxCURSOR_SIZENESW,
wxCURSOR_SIZENS,
wxCURSOR_SIZENWSE,
wxCURSOR_SIZEWE,
wxCURSOR_SIZING,
wxCURSOR_SPRAYCAN,
wxCURSOR_WAIT,
wxCURSOR_WATCH,
wxCURSOR_BLANK
#ifdef __X__
/* Not yet implemented for Windows */
, wxCURSOR_CROSS_REVERSE,
wxCURSOR_DOUBLE_ARROW,
wxCURSOR_BASED_ARROW_UP,
wxCURSOR_BASED_ARROW_DOWN
#endif
} _standard_cursors_t;
class WXDLLEXPORT wxSize: public wxObject
{
public:
long x;
long y;
inline wxSize(void) { x = 0; y = 0; }
inline wxSize(long xx, long yy) { x = xx; y = yy; }
inline wxSize(const wxSize& sz) { x = sz.x; y = sz.y; }
inline void operator = (const wxSize& sz) { x = sz.x; y = sz.y; }
inline void Set(long xx, long yy) { x = xx; y = yy; }
inline long GetX() const { return x; }
inline long GetY() const { return y; }
};
// Point
class WXDLLEXPORT wxRealPoint: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxRealPoint)
public:
double x;
double y;
inline wxRealPoint(void) { x = 0.0; y = 0.0; };
inline wxRealPoint(double the_x, double the_y) { x = the_x; y = the_y; };
inline void operator = (const wxRealPoint& pt) { x = pt.x; y = pt.y; }
};
class WXDLLEXPORT wxPoint: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxPoint)
public:
long x;
long y;
inline wxPoint(void) { x = 0; y = 0; };
wxPoint(long the_x, long the_y) { x = the_x; y = the_y; };
inline void operator = (const wxPoint& pt) { x = pt.x; y = pt.y; }
};
#if WXWIN_COMPATIBILITY
#define wxIntPoint wxPoint
#define wxRectangle wxRect
#endif
class WXDLLEXPORT wxRect : public wxObject {
DECLARE_DYNAMIC_CLASS(wxRect)
public:
wxRect(void) ;
wxRect(const long x, const long y, const long w, const long h);
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRect(const wxPoint& pos, const wxSize& size);
wxRect(const wxRect& rect);
inline long GetX(void) const { return x; }
inline void SetX(const long X) { x = X; }
inline long GetY(void) const { return y; }
inline void SetY(const long Y) { y = Y; }
inline long GetWidth() const { return width; }
inline void SetWidth(const long w) { width = w; }
inline long GetHeight() const { return height; }
inline void SetHeight(const long h) { height = h; }
inline wxPoint GetPosition(void) { return wxPoint(x, y); }
inline wxSize GetSize(void) { return wxSize(width, height); }
inline long GetLeft(void) const { return x; }
inline long GetTop(void) const { return y; }
inline long GetBottom(void) const { return y + height; }
inline long GetRight(void) const { return x + width; }
wxRect& operator = (const wxRect& rect);
bool operator == (const wxRect& rect);
bool operator != (const wxRect& rect);
public:
long x, y, width, height;
};
class WXDLLEXPORT wxBrush;
class WXDLLEXPORT wxPen;
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxFont;
class WXDLLEXPORT wxPalette;
class WXDLLEXPORT wxPalette;
/*
* Bitmap flags
*/
// Hint to indicate filetype
#define wxBITMAP_TYPE_BMP 1
#define wxBITMAP_TYPE_BMP_RESOURCE 2
#define wxBITMAP_TYPE_ICO 3
#define wxBITMAP_TYPE_ICO_RESOURCE 4
#define wxBITMAP_TYPE_CUR 5
#define wxBITMAP_TYPE_CUR_RESOURCE 6
#define wxBITMAP_TYPE_XBM 7
#define wxBITMAP_TYPE_XBM_DATA 8
#define wxBITMAP_TYPE_XPM 9
#define wxBITMAP_TYPE_XPM_DATA 10
#define wxBITMAP_TYPE_TIF 11
#define wxBITMAP_TYPE_TIF_RESOURCE 12
#define wxBITMAP_TYPE_GIF 13
#define wxBITMAP_TYPE_GIF_RESOURCE 14
#define wxBITMAP_TYPE_PNG 15
#define wxBITMAP_TYPE_PNG_RESOURCE 16
#define wxBITMAP_TYPE_ANY 50
#define wxBITMAP_TYPE_RESOURCE wxBITMAP_TYPE_BMP_RESOURCE
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxIcon;
// Management of pens, brushes and fonts
class WXDLLEXPORT wxPenList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxPenList)
public:
inline wxPenList(void)
{ }
~wxPenList(void);
void AddPen(wxPen *pen);
void RemovePen(wxPen *pen);
wxPen *FindOrCreatePen(const wxColour& colour, const int width, const int style);
wxPen *FindOrCreatePen(const wxString& colour, const int width, const int style);
};
class WXDLLEXPORT wxBrushList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxBrushList)
public:
inline wxBrushList(void)
{ }
~wxBrushList(void);
void AddBrush(wxBrush *brush);
void RemoveBrush(wxBrush *brush);
wxBrush *FindOrCreateBrush(const wxColour& colour, const int style);
wxBrush *FindOrCreateBrush(const wxString& colour, const int style);
};
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
class WXDLLEXPORT wxFontList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxFontList)
public:
inline wxFontList(void)
{ }
~wxFontList(void);
void AddFont(wxFont *font);
void RemoveFont(wxFont *font);
wxFont *FindOrCreateFont(const int pointSize, const int family, const int style, const int weight,
const bool underline = FALSE, const wxString& face = wxEmptyString);
};
class WXDLLEXPORT wxColourDatabase: public wxList
{
DECLARE_CLASS(wxColourDatabase)
public:
wxColourDatabase(int type);
~wxColourDatabase(void) ;
// Not const because it may add a name to the database
wxColour *FindColour(const wxString& colour) ;
wxString FindName(const wxColour& colour) const;
void Initialize(void);
};
class WXDLLEXPORT wxBitmapList: public wxList
{
DECLARE_DYNAMIC_CLASS(wxBitmapList)
public:
wxBitmapList(void);
~wxBitmapList(void);
void AddBitmap(wxBitmap *bitmap);
void RemoveBitmap(wxBitmap *bitmap);
};
// Lists of GDI objects
WXDLLEXPORT_DATA(extern wxPenList*) wxThePenList;
WXDLLEXPORT_DATA(extern wxBrushList*) wxTheBrushList;
WXDLLEXPORT_DATA(extern wxFontList*) wxTheFontList;
WXDLLEXPORT_DATA(extern wxBitmapList*) wxTheBitmapList;
// Stock objects
WXDLLEXPORT_DATA(extern wxFont*) wxNORMAL_FONT;
WXDLLEXPORT_DATA(extern wxFont*) wxSMALL_FONT;
WXDLLEXPORT_DATA(extern wxFont*) wxITALIC_FONT;
WXDLLEXPORT_DATA(extern wxFont*) wxSWISS_FONT;
WXDLLEXPORT_DATA(extern wxPen*) wxRED_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxCYAN_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxGREEN_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxBLACK_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxWHITE_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxTRANSPARENT_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxBLACK_DASHED_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxGREY_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxMEDIUM_GREY_PEN;
WXDLLEXPORT_DATA(extern wxPen*) wxLIGHT_GREY_PEN;
WXDLLEXPORT_DATA(extern wxBrush*) wxBLUE_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxGREEN_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxWHITE_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxBLACK_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxGREY_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxMEDIUM_GREY_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxLIGHT_GREY_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxTRANSPARENT_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxCYAN_BRUSH;
WXDLLEXPORT_DATA(extern wxBrush*) wxRED_BRUSH;
WXDLLEXPORT_DATA(extern wxColour*) wxBLACK;
WXDLLEXPORT_DATA(extern wxColour*) wxWHITE;
WXDLLEXPORT_DATA(extern wxColour*) wxRED;
WXDLLEXPORT_DATA(extern wxColour*) wxBLUE;
WXDLLEXPORT_DATA(extern wxColour*) wxGREEN;
WXDLLEXPORT_DATA(extern wxColour*) wxCYAN;
WXDLLEXPORT_DATA(extern wxColour*) wxLIGHT_GREY;
// 'Null' objects
WXDLLEXPORT_DATA(extern wxBitmap) wxNullBitmap;
WXDLLEXPORT_DATA(extern wxIcon) wxNullIcon;
WXDLLEXPORT_DATA(extern wxCursor) wxNullCursor;
WXDLLEXPORT_DATA(extern wxPen) wxNullPen;
WXDLLEXPORT_DATA(extern wxBrush) wxNullBrush;
WXDLLEXPORT_DATA(extern wxPalette) wxNullPalette;
WXDLLEXPORT_DATA(extern wxFont) wxNullFont;
WXDLLEXPORT_DATA(extern wxColour) wxNullColour;
// Stock cursors types
WXDLLEXPORT_DATA(extern wxCursor*) wxSTANDARD_CURSOR;
WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR;
WXDLLEXPORT_DATA(extern wxCursor*) wxCROSS_CURSOR;
WXDLLEXPORT_DATA(extern wxColourDatabase*) wxTheColourDatabase;
extern void WXDLLEXPORT wxInitializeStockObjects(void);
extern void WXDLLEXPORT wxDeleteStockObjects(void);
extern bool WXDLLEXPORT wxColourDisplay(void);
// Returns depth of screen
extern int WXDLLEXPORT wxDisplayDepth(void);
extern void WXDLLEXPORT wxDisplaySize(int *width, int *height);
extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor);
// Useful macro for create icons portably
#ifdef __WINDOWS__
# define wxICON(X) wxIcon(X##_icon);
#elif defined(__X__)
# define wxICON(X) wxIcon(X##_bits, X##_width, X##_height);
#else
# define wxICON wxIcon
#endif
/*
Example:
#define wxbuild_icon "wxbuild"
wxIcon *icon = new wxICON(wxbuild);
*/
#endif
// __GDICMNH__

13
include/wx/gdiobj.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __GDIOBJH_BASE__
#define __GDIOBJH_BASE__
#if defined(__WINDOWS__)
#include "wx/msw/gdiobj.h"
#elif defined(__MOTIF__)
#include "wx/xt/gdiobj.h"
#elif defined(__GTK__)
#include "wx/gtk/gdiobj.h"
#endif
#endif
// __GDIOBJH_BASE__

View 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

View 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

View 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
View 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

View 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__

View 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__

View 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__

View 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__

View 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__

View 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__

View 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__

View 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__

View 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

View 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
View 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

View 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__

View 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__

11
include/wx/grid.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef __GRIDH_BASE__
#define __GRIDH_BASE__
#include "wx/generic/gridg.h"
#ifndef wxGrid
#define wxGrid wxGenericGrid
#endif
#endif
// __GRIDH_BASE__

113
include/wx/gtk/app.h Normal file
View File

@@ -0,0 +1,113 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKAPPH__
#define __GTKAPPH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/window.h"
#include "wx/frame.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxApp;
class wxLog;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern wxApp *wxTheApp;
//-----------------------------------------------------------------------------
// global functions
//-----------------------------------------------------------------------------
void wxExit(void);
bool wxYield(void);
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define wxPRINT_WINDOWS 1
#define wxPRINT_POSTSCRIPT 2
//-----------------------------------------------------------------------------
// wxApp
//-----------------------------------------------------------------------------
class wxApp: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxApp)
public:
wxApp(void);
~wxApp(void);
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
static wxAppInitializerFunction GetInitializerFunction(void) { return m_appInitFn; }
virtual bool OnInit(void);
virtual bool OnInitGui(void);
virtual int OnRun(void);
virtual bool OnIdle(void);
virtual int OnExit(void);
wxWindow *GetTopWindow(void);
void SetTopWindow( wxWindow *win );
virtual int MainLoop(void);
void ExitMainLoop(void);
bool Initialized(void);
virtual bool Pending(void);
virtual void Dispatch(void);
void DeletePendingObjects(void);
inline wxString GetAppName(void) const {
if (m_appName != "")
return m_appName;
else return m_className;
}
inline void SetAppName(const wxString& name) { m_appName = name; };
inline wxString GetClassName(void) const { return m_className; }
inline void SetClassName(const wxString& name) { m_className = name; }
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete; }
void SetPrintMode(int WXUNUSED(mode) ) {};
int GetPrintMode(void) const { return wxPRINT_POSTSCRIPT; };
static void CommonInit(void);
static void CommonCleanUp(void);
// override this function to create default log target of arbitrary
// user-defined classv (default implementation creates a wxLogGui object)
virtual wxLog *CreateLogTarget();
bool m_initialized;
bool m_exitOnFrameDelete;
gint m_idleTag;
wxWindow *m_topWindow;
wxString m_appName;
wxString m_className;
int argc;
char **argv;
static wxAppInitializerFunction m_appInitFn;
};
#endif // __GTKAPPH__

118
include/wx/gtk/bitmap.h Normal file
View File

@@ -0,0 +1,118 @@
/////////////////////////////////////////////////////////////////////////////
// Name: bitmap.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKBITMAPH__
#define __GTKBITMAPH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/palette.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxMemoryDC;
class wxToolBarGTK;
class wxMask;
class wxBitmap;
//-----------------------------------------------------------------------------
// wxMask
//-----------------------------------------------------------------------------
class wxMask: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxMask)
public:
wxMask(void);
wxMask( const wxBitmap& bitmap, const wxColour& colour );
wxMask( const wxBitmap& bitmap, const int paletteIndex );
wxMask( const wxBitmap& bitmap );
~wxMask(void);
private:
friend wxBitmap;
friend wxDC;
friend wxPaintDC;
friend wxToolBarGTK;
GdkBitmap *GetBitmap(void) const;
protected:
GdkBitmap *m_bitmap;
};
//-----------------------------------------------------------------------------
// wxBitmap
//-----------------------------------------------------------------------------
class wxBitmap: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxBitmap)
public:
wxBitmap(void);
wxBitmap( const int width, const int height, const int depth = -1 );
wxBitmap( char **bits );
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxBitmap* bmp );
wxBitmap( const wxString &filename, const int type );
~wxBitmap(void);
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp );
bool operator != ( const wxBitmap& bmp );
bool Ok(void) const;
int GetHeight(void) const;
int GetWidth(void) const;
int GetDepth(void) const;
void SetHeight( const int height );
void SetWidth( const int width );
void SetDepth( const int depth );
wxMask *GetMask(void) const;
void SetMask( wxMask *mask );
bool SaveFile( const wxString &name, const int type, wxPalette *palette = NULL );
bool LoadFile( const wxString &name, const int type );
wxPalette *GetPalette(void) const;
wxPalette *GetColourMap(void) const
{ return GetPalette(); };
private:
friend wxDC;
friend wxPaintDC;
friend wxMemoryDC;
friend wxToolBarGTK;
GdkPixmap *GetPixmap(void) const;
// no data :-)
};
#endif // __GTKBITMAPH__

34
include/wx/gtk/bmpbuttn.h Normal file
View File

@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: bmpbutton.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __BMPBUTTONH__
#define __BMPBUTTONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxBitmapButton;
//-----------------------------------------------------------------------------
// wxBitmapButton
//-----------------------------------------------------------------------------
#endif // __BMPBUTTONH__

60
include/wx/gtk/brush.h Normal file
View File

@@ -0,0 +1,60 @@
/////////////////////////////////////////////////////////////////////////////
// Name: brush.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKBRUSHH__
#define __GTKBRUSHH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxBrush;
//-----------------------------------------------------------------------------
// wxBrush
//-----------------------------------------------------------------------------
class wxBrush: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxBrush)
public:
wxBrush(void);
wxBrush( const wxColour &colour, const int style );
wxBrush( const wxString &colourName, const int style );
wxBrush( const wxBitmap &stippleBitmap );
wxBrush( const wxBrush &brush );
wxBrush( const wxBrush *brush );
~wxBrush(void);
wxBrush& operator = ( const wxBrush& brush );
bool operator == ( const wxBrush& brush );
bool operator != ( const wxBrush& brush );
bool Ok(void) const;
int GetStyle(void) const;
wxColour &GetColour(void) const;
wxBitmap *GetStipple(void) const;
// no data :-)
};
#endif // __GTKBRUSHH__

58
include/wx/gtk/button.h Normal file
View File

@@ -0,0 +1,58 @@
/////////////////////////////////////////////////////////////////////////////
// Name: button.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKBUTTONH__
#define __GTKBUTTONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxButton;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxButtonNameStr;
//-----------------------------------------------------------------------------
// wxButton
//-----------------------------------------------------------------------------
class wxButton: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxButton)
public:
wxButton(void);
wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxButtonNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxButtonNameStr );
void SetDefault(void);
void SetLabel( const wxString &label );
wxString GetLabel(void) const;
};
#endif // __GTKBUTTONH__

57
include/wx/gtk/checkbox.h Normal file
View File

@@ -0,0 +1,57 @@
/////////////////////////////////////////////////////////////////////////////
// Name: checkbox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCHECKBOXH__
#define __GTKCHECKBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxCheckBox;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxCheckBoxNameStr;
//-----------------------------------------------------------------------------
// wxCheckBox
//-----------------------------------------------------------------------------
class wxCheckBox: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxCheckBox)
public:
wxCheckBox(void);
wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxCheckBoxNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxCheckBoxNameStr );
void SetValue( const bool state );
bool GetValue(void) const;
};
#endif // __GTKCHECKBOXH__

68
include/wx/gtk/choice.h Normal file
View File

@@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////
// Name: choice.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCHOICEH__
#define __GTKCHOICEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxChoice;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxChoiceNameStr;
//-----------------------------------------------------------------------------
// wxChoice
//-----------------------------------------------------------------------------
class wxChoice: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxChoice)
public:
wxChoice(void);
wxChoice( wxWindow *parent, const wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxChoiceNameStr );
bool Create( wxWindow *parent, const wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxChoiceNameStr );
void Append( const wxString &item );
void Clear(void);
int FindString( const wxString &string ) const;
int GetColumns(void) const;
int GetSelection(void);
wxString GetString( const int n ) const;
wxString GetStringSelection(void) const;
int Number(void) const;
void SetColumns( const int n = 1 );
void SetSelection( const int n );
void SetStringSelection( const wxString &string );
};
#endif // __GTKCHOICEH__

76
include/wx/gtk/colour.h Normal file
View File

@@ -0,0 +1,76 @@
/////////////////////////////////////////////////////////////////////////////
// Name: colour.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCOLOURH__
#define __GTKCOLOURH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxBitmap;
class wxWindow;
class wxColour;
//-----------------------------------------------------------------------------
// wxColour
//-----------------------------------------------------------------------------
class wxColour: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxColour)
public:
wxColour(void);
wxColour( char red, char green, char blue );
wxColour( const wxString &colourName );
wxColour( const wxColour& col );
wxColour( const wxColour* col );
~wxColour(void);
wxColour& operator = ( const wxColour& col );
wxColour& operator = ( const wxString& colourName );
bool operator == ( const wxColour& col );
bool operator != ( const wxColour& col );
void Set( const unsigned char red, const unsigned char green, const unsigned char blue );
unsigned char Red(void) const;
unsigned char Green(void) const;
unsigned char Blue(void) const;
bool Ok(void) const;
private:
public:
friend wxDC;
friend wxPaintDC;
friend wxBitmap;
friend wxWindow;
void CalcPixel( GdkColormap *cmap );
int GetPixel(void);
GdkColor *GetColor(void);
// no data :-)
};
#endif // __GTKCOLOURH__

34
include/wx/gtk/combobox.h Normal file
View File

@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: combobox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCOMBOBOXH__
#define __GTKCOMBOBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxComboBox;
//-----------------------------------------------------------------------------
// wxComboBox
//-----------------------------------------------------------------------------
#endif // __GTKCOMBOBOXH__

51
include/wx/gtk/control.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: control.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCONTROLH__
#define __GTKCONTROLH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxControl;
//-----------------------------------------------------------------------------
// wxControl
//-----------------------------------------------------------------------------
class wxControl: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxControl)
public:
wxControl(void);
wxControl( wxWindow *parent, wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxPanelNameStr );
virtual void Command( wxCommandEvent &event );
virtual void SetLabel( const wxString &label );
virtual wxString GetLabel(void) const;
wxString m_label;
};
#endif // __GTKCONTROLH__

61
include/wx/gtk/cursor.h Normal file
View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////
// Name: cursor.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKCURSORH__
#define __GTKCURSORH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxWindow;
class wxCursor;
//-----------------------------------------------------------------------------
// wxCursor
//-----------------------------------------------------------------------------
class wxCursor: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxCursor)
public:
wxCursor(void);
wxCursor( const int cursorId );
wxCursor( const wxCursor &cursor );
wxCursor( const wxCursor *cursor );
~wxCursor(void);
wxCursor& operator = ( const wxCursor& cursor );
bool operator == ( const wxCursor& cursor );
bool operator != ( const wxCursor& cursor );
bool Ok(void) const;
private:
public:
friend wxWindow;
GdkCursor *GetCursor(void) const;
// no data :-)
};
#endif // __GTKCURSORH__

306
include/wx/gtk/dc.h Normal file
View File

@@ -0,0 +1,306 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dc.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCH__
#define __GTKDCH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdicmn.h"
#include "wx/pen.h"
#include "wx/brush.h"
#include "wx/icon.h"
#include "wx/font.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define MM_TEXT 0
#define MM_ISOTROPIC 1
#define MM_ANISOTROPIC 2
#define MM_LOMETRIC 3
#define MM_HIMETRIC 4
#define MM_TWIPS 5
#define MM_POINTS 6
#define MM_METRIC 7
//-----------------------------------------------------------------------------
// global variables
//-----------------------------------------------------------------------------
extern int wxPageNumber;
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
class wxDC: public wxObject
{
DECLARE_ABSTRACT_CLASS(wxDC)
public:
wxDC(void);
~wxDC(void);
void BeginDrawing(void) {};
void EndDrawing(void) {};
virtual bool Ok(void) const { return m_ok; };
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0;
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0;
virtual void CrossHair( long x, long y ) = 0;
virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc );
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0;
virtual void DrawPoint( long x, long y ) = 0;
virtual void DrawPoint( wxPoint& point );
virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ) = 0;
virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 );
virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE ) = 0;
virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE );
virtual void DrawRectangle( long x, long y, long width, long height ) = 0;
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0;
virtual void DrawEllipse( long x, long y, long width, long height ) = 0;
virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 );
virtual void DrawSpline( wxList *points );
virtual void DrawSpline( int n, wxPoint points[] );
virtual bool CanDrawBitmap(void) const = 0;
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
virtual bool Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0;
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0;
virtual bool CanGetTextExtent(void) const = 0;
virtual void GetTextExtent( const wxString &string, long *width, long *height,
long *descent = NULL, long *externalLeading = NULL,
wxFont *theFont = NULL, bool use16 = FALSE ) = 0;
virtual long GetCharWidth(void) = 0;
virtual long GetCharHeight(void) = 0;
virtual void Clear(void) = 0;
virtual void SetFont( const wxFont &font ) = 0;
virtual wxFont *GetFont(void) { return &m_font; };
virtual void SetPen( const wxPen &pen ) = 0;
virtual wxPen *GetPen(void) { return &m_pen; };
virtual void SetBrush( const wxBrush &brush ) = 0;
virtual wxBrush *GetBrush(void) { return &m_brush; };
virtual void SetLogicalFunction( int function ) = 0;
virtual int GetLogicalFunction(void) { return m_logicalFunction; };
virtual void SetTextForeground( const wxColour &col );
virtual void SetTextBackground( const wxColour &col );
virtual wxColour& GetTextBackground(void) const { return (wxColour&)m_textBackgroundColour; };
virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; };
virtual void SetBackgroundMode( int mode ) = 0;
virtual int GetBackgroundMode(void) { return m_backgroundMode; };
virtual void SetPalette( const wxPalette& palette ) = 0;
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
// the first two must be overridden and called
virtual void SetClippingRegion( long x, long y, long width, long height );
virtual void DestroyClippingRegion(void);
virtual void GetClippingBox( long *x, long *y, long *width, long *height ) const;
virtual inline long MinX(void) const { return m_minX; }
virtual inline long MaxX(void) const { return m_maxX; }
virtual inline long MinY(void) const { return m_minY; }
virtual inline long MaxY(void) const { return m_maxY; }
virtual void GetSize( int* width, int* height ) const;
inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); }
virtual void GetSizeMM( long* width, long* height ) const;
virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; };
virtual void EndDoc(void) {};
virtual void StartPage(void) {};
virtual void EndPage(void) {};
virtual void SetMapMode( int mode );
virtual int GetMapMode(void) const { return m_mappingMode; };
virtual void SetUserScale( double x, double y );
virtual void GetUserScale( double *x, double *y );
virtual void SetLogicalScale( double x, double y );
virtual void GetLogicalScale( double *x, double *y );
virtual void SetLogicalOrigin( long x, long y );
virtual void GetLogicalOrigin( long *x, long *y );
virtual void SetDeviceOrigin( long x, long y );
virtual void GetDeviceOrigin( long *x, long *y );
virtual void SetInternalDeviceOrigin( long x, long y );
virtual void GetInternalDeviceOrigin( long *x, long *y );
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
virtual void SetOptimization( bool WXUNUSED(optimize) ) {};
virtual bool GetOptimization(void) { return m_optimize; };
virtual long DeviceToLogicalX(long x) const;
virtual long DeviceToLogicalY(long y) const;
virtual long DeviceToLogicalXRel(long x) const;
virtual long DeviceToLogicalYRel(long y) const;
virtual long LogicalToDeviceX(long x) const;
virtual long LogicalToDeviceY(long y) const;
virtual long LogicalToDeviceXRel(long x) const;
virtual long LogicalToDeviceYRel(long y) const;
public:
void CalcBoundingBox( long x, long y );
void ComputeScaleAndOrigin(void);
long XDEV2LOG(long x) const
{
long new_x = x - m_deviceOriginX;
if (new_x > 0)
return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
else
return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
}
long XDEV2LOGREL(long x) const
{
if (x > 0)
return (long)((double)(x) / m_scaleX + 0.5);
else
return (long)((double)(x) / m_scaleX - 0.5);
}
long YDEV2LOG(long y) const
{
long new_y = y - m_deviceOriginY;
if (new_y > 0)
return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
else
return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
}
long YDEV2LOGREL(long y) const
{
if (y > 0)
return (long)((double)(y) / m_scaleY + 0.5);
else
return (long)((double)(y) / m_scaleY - 0.5);
}
long XLOG2DEV(long x) const
{
long new_x = x - m_logicalOriginX;
if (new_x > 0)
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
else
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
}
long XLOG2DEVREL(long x) const
{
if (x > 0)
return (long)((double)(x) * m_scaleX + 0.5);
else
return (long)((double)(x) * m_scaleX - 0.5);
}
long YLOG2DEV(long y) const
{
long new_y = y - m_logicalOriginY;
if (new_y > 0)
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
else
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
}
long YLOG2DEVREL(long y) const
{
if (y > 0)
return (long)((double)(y) * m_scaleY + 0.5);
else
return (long)((double)(y) * m_scaleY - 0.5);
}
virtual void DrawOpenSpline( wxList *points ) = 0;
public:
bool m_ok;
bool m_colour;
// not sure, what these mean
bool m_clipping; // Is clipping on right now ?
bool m_isInteractive; // Is GetPixel possible ?
bool m_autoSetting; // wxMSW only ?
bool m_dontDelete; // wxMSW only ?
bool m_optimize; // wxMSW only ?
wxString m_filename; // Not sure where this belongs.
wxPen m_pen;
wxBrush m_brush;
wxBrush m_backgroundBrush;
wxColour m_textForegroundColour;
wxColour m_textBackgroundColour;
wxFont m_font;
int m_logicalFunction;
int m_backgroundMode;
int m_textAlignment; // gone in wxWin 2.0 ?
int m_mappingMode;
// not sure what for, but what is a mm on a screen you don't know the size of?
double m_mm_to_pix_x,m_mm_to_pix_y;
long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or
// d.o. changes with scrolling.
// Set using SetInternalDeviceOrigin().
long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes
// such as wxScrolledWindow
// using SetDeviceOrigin()
long m_deviceOriginX,m_deviceOriginY; // Sum of the two above.
long m_logicalOriginX,m_logicalOriginY; // User defined.
double m_scaleX,m_scaleY;
double m_logicalScaleX,m_logicalScaleY;
double m_userScaleX,m_userScaleY;
long m_signX,m_signY;
bool m_needComputeScaleX,m_needComputeScaleY; // not yet used
float m_scaleFactor; // wxPSDC wants to have this. Will disappear.
long m_clipX1,m_clipY1,m_clipX2,m_clipY2;
long m_minX,m_maxX,m_minY,m_maxY;
};
#endif // __GTKDCH__

107
include/wx/gtk/dcclient.h Normal file
View File

@@ -0,0 +1,107 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcclient.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCCLIENTH__
#define __GTKDCCLIENTH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/dc.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxPaintDC;
typedef wxPaintDC wxClientDC;
typedef wxPaintDC wxWindowDC;
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
class wxPaintDC: public wxDC
{
DECLARE_DYNAMIC_CLASS(wxPaintDC)
public:
wxPaintDC(void);
wxPaintDC( wxWindow *win );
~wxPaintDC(void);
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE );
virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
virtual void DrawLine( long x1, long y1, long x2, long y2 );
virtual void CrossHair( long x, long y );
virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc );
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea );
virtual void DrawPoint( long x, long y );
virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 );
virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 );
virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE );
virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0,
int fillStyle=wxODDEVEN_RULE );
virtual void DrawRectangle( long x, long y, long width, long height );
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 );
virtual void DrawEllipse( long x, long y, long width, long height );
virtual bool CanDrawBitmap(void) const;
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
virtual bool Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE );
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE );
virtual bool CanGetTextExtent(void) const;
virtual void GetTextExtent( const wxString &string, long *width, long *height,
long *descent = NULL, long *externalLeading = NULL,
wxFont *theFont = NULL, bool use16 = FALSE );
virtual long GetCharWidth(void);
virtual long GetCharHeight(void);
virtual void Clear(void);
virtual void SetFont( const wxFont &font );
virtual void SetPen( const wxPen &pen );
virtual void SetBrush( const wxBrush &brush );
virtual void SetLogicalFunction( int function );
virtual void SetTextForeground( const wxColour &col );
virtual void SetTextBackground( const wxColour &col );
virtual void SetBackgroundMode( int mode );
virtual void SetPalette( const wxPalette& palette );
virtual void SetClippingRegion( long x, long y, long width, long height );
virtual void DestroyClippingRegion(void);
virtual void DrawOpenSpline( wxList *points );
public: // shouldn't be public
GdkWindow *m_window;
GdkGC *m_penGC;
GdkGC *m_brushGC;
GdkGC *m_textGC;
GdkGC *m_bgGC;
GdkColormap *m_cmap;
void SetUpDC(void);
GdkWindow *GetWindow(void);
};
#endif // __GTKDCCLIENTH__

49
include/wx/gtk/dcmemory.h Normal file
View File

@@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcmemory.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCMEMORYH__
#define __GTKDCMEMORYH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/dcclient.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMemoryDC;
//-----------------------------------------------------------------------------
// wxMemoryDC
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxMemoryDC: public wxPaintDC
{
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
public:
wxMemoryDC(void);
wxMemoryDC( wxDC *dc ); // Create compatible DC
~wxMemoryDC(void);
virtual void SelectObject( const wxBitmap& bitmap );
void GetSize( int *width, int *height );
private:
wxBitmap m_selected;
};
#endif
// __GTKDCMEMORYH__

32
include/wx/gtk/dcscreen.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dcscreen.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDCSCREENH__
#define __GTKDCSCREENH__
#include "wx/dcclient.h"
class WXDLLEXPORT wxScreenDC: public wxPaintDC
{
DECLARE_DYNAMIC_CLASS(wxScreenDC)
public:
wxScreenDC(void);
~wxScreenDC(void);
static bool StartDrawingOnTop( wxWindow *window );
static bool StartDrawingOnTop( wxRectangle *rect = NULL );
static bool EndDrawingOnTop(void);
};
#endif
// __GTKDCSCREENH__

95
include/wx/gtk/dialog.h Normal file
View File

@@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDIALOGH__
#define __GTKDIALOGH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/event.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// forward decls
//-----------------------------------------------------------------------------
class wxRadioBox;
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDialog;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxDialogNameStr;
//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------
class wxDialog: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxDialog)
public:
wxDialog(void);
wxDialog( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
~wxDialog(void);
void SetTitle(const wxString& title);
wxString GetTitle(void) const;
bool OnClose(void);
void OnApply( wxCommandEvent &event );
void OnCancel( wxCommandEvent &event );
void OnOk( wxCommandEvent &event );
void OnPaint(wxPaintEvent& event);
void OnCloseWindow(wxCloseEvent& event);
/*
void OnCharHook(wxKeyEvent& event);
*/
virtual bool Show( const bool show );
virtual int ShowModal(void);
virtual void EndModal(int retCode);
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
virtual void InitDialog(void);
/*
void OnOK(wxCommandEvent& event);
void OnApply(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
*/
private:
friend wxWindow;
friend wxDC;
friend wxRadioBox;
bool m_modalShowing;
wxString m_title;
DECLARE_EVENT_TABLE()
};
#endif // __GTKDIALOGH__

35
include/wx/gtk/dirdlg.h Normal file
View File

@@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dirdlg.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __DIRDIALOGH__
#define __DIRDIALOGH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/dialog.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDirDialog;
//-----------------------------------------------------------------------------
// wxDirDialog
//-----------------------------------------------------------------------------
#endif // __DIRDIALOGH__

116
include/wx/gtk/dnd.h Normal file
View File

@@ -0,0 +1,116 @@
///////////////////////////////////////////////////////////////////////////////
// Name: dnd.h
// Purpose: declaration of the wxDropTarget class
// Author: Robert Roebling
// RCS-ID:
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef __GTKDNDH__
#define __GTKDNDH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/cursor.h"
//-------------------------------------------------------------------------
// classes
//-------------------------------------------------------------------------
class wxWindow;
class wxDropTarget;
class wxTextDropTarget;
class wxDragSource;
class wxTextDragSource;
//-------------------------------------------------------------------------
// wxDropTarget
//-------------------------------------------------------------------------
class wxDropTarget: wxObject
{
public:
wxDropTarget();
~wxDropTarget();
virtual void OnEnter() { }
virtual void OnLeave() { }
virtual bool OnDrop( long x, long y, const void *pData ) = 0;
public:
void Drop( GdkEvent *event, int x, int y );
virtual void RegisterWidget( GtkWidget *widget ) = 0;
void UnregisterWidget( GtkWidget *widget );
};
//-------------------------------------------------------------------------
// wxTextDropTarget
//-------------------------------------------------------------------------
class wxTextDropTarget: public wxDropTarget
{
public:
wxTextDropTarget() {};
virtual bool OnDrop( long x, long y, const void *pData );
virtual bool OnDropText( long x, long y, const char *psz );
virtual void RegisterWidget( GtkWidget *widget );
};
//-------------------------------------------------------------------------
// wxDragSource
//-------------------------------------------------------------------------
class wxDragSource: public wxObject
{
public:
wxDragSource( wxWindow *win );
~wxDragSource(void);
void SetData( char *data, const long size );
void Start( int x, int y );
public:
void ConnectWindow(void);
void UnconnectWindow(void);
virtual void RegisterWindow(void) = 0;
void UnregisterWindow(void);
GtkWidget *m_widget;
wxWindow *m_window;
char *m_data;
long m_size;
wxCursor m_defaultCursor;
wxCursor m_goaheadCursor;
};
//-------------------------------------------------------------------------
// wxTextDragSource
//-------------------------------------------------------------------------
class wxTextDragSource: public wxDragSource
{
public:
wxTextDragSource( wxWindow *win ) : wxDragSource(win) {};
void SetTextData( const wxString &text );
void RegisterWindow(void);
private:
wxString m_tmp;
};
#endif
//__GTKDNDH__

93
include/wx/gtk/filedlg.h Normal file
View File

@@ -0,0 +1,93 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filedlg.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKFILEDLGH__
#define __GTKFILEDLGH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/dialog.h"
//-------------------------------------------------------------------------
// File selector
//-------------------------------------------------------------------------
extern const char *wxFileSelectorPromptStr;
extern const char *wxFileSelectorDefaultWildcardStr;
class wxFileDialog: public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxFileDialog)
public:
wxFileDialog() {};
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = "", const wxString& defaultFile = "",
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0, const wxPoint& pos = wxDefaultPosition);
inline void SetMessage(const wxString& message) { m_message = message; }
inline void SetPath(const wxString& path) { m_path = path; }
inline void SetDirectory(const wxString& dir) { m_dir = dir; }
inline void SetFilename(const wxString& name) { m_fileName = name; }
inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
inline void SetStyle(long style) { m_dialogStyle = style; }
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
inline wxString GetMessage(void) const { return m_message; }
inline wxString GetPath(void) const { return m_path; }
inline wxString GetDirectory(void) const { return m_dir; }
inline wxString GetFilename(void) const { return m_fileName; }
inline wxString GetWildcard(void) const { return m_wildCard; }
inline long GetStyle(void) const { return m_dialogStyle; }
inline int GetFilterIndex(void) const { return m_filterIndex ; }
int ShowModal(void);
protected:
wxString m_message;
long m_dialogStyle;
wxWindow * m_parent;
wxString m_dir;
wxString m_path; // Full path
wxString m_fileName;
wxString m_wildCard;
int m_filterIndex;
};
#define wxOPEN 1
#define wxSAVE 2
#define wxOVERWRITE_PROMPT 4
#define wxHIDE_READONLY 8
// File selector - backward compatibility
char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, const char *default_extension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1);
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL,
wxWindow *parent = NULL);
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL,
wxWindow *parent = NULL);
#endif
// __GTKFILEDLGH__

120
include/wx/gtk/font.h Normal file
View File

@@ -0,0 +1,120 @@
/////////////////////////////////////////////////////////////////////////////
// Name: font.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKFONTH__
#define __GTKFONTH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/hash.h"
#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxDC;
class wxPaintDC;
class wxWindow;
class wxFont;
class wxFontNameDirectory;
//-----------------------------------------------------------------------------
// global variables
//-----------------------------------------------------------------------------
// extern wxFontNameDirectory wxTheFontNameDirectory; // defined below
//-----------------------------------------------------------------------------
// wxFont
//-----------------------------------------------------------------------------
class wxFont: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxFont)
public:
wxFont(void);
wxFont( int PointSize, int FontIdOrFamily, int Style, int Weight,
bool underlined = FALSE, const char *Face=NULL );
wxFont( int PointSize, const char *Face, int Family, int Style, int Weight,
bool underlined = FALSE );
wxFont( const wxFont& font );
wxFont( const wxFont* font );
~wxFont(void);
wxFont& operator = ( const wxFont& font );
bool operator == ( const wxFont& font );
bool operator != ( const wxFont& font );
bool Ok();
int GetPointSize(void) const;
wxString GetFaceName(void) const;
int GetFamily(void) const;
wxString GetFamilyString(void) const;
int GetFontId(void) const;
wxString GetFaceString(void) const;
int GetStyle(void) const;
wxString GetStyleString(void) const;
int GetWeight(void) const;
wxString GetWeightString(void) const;
bool GetUnderlined(void) const;
wxFont( char *xFontName );
private:
friend wxDC;
friend wxPaintDC;
friend wxWindow;
GdkFont* GetInternalFont(float scale = 1.0);
// no data :-)
};
//-----------------------------------------------------------------------------
// wxFontDirectory
//-----------------------------------------------------------------------------
class wxFontNameDirectory: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFontNameDirectory)
public:
wxFontNameDirectory(void);
~wxFontNameDirectory();
void Initialize(void);
void Initialize(int fontid, int family, const char *name);
int FindOrCreateFontId(const char *name, int family);
char* GetAFMName(int fontid, int weight, int style);
int GetFamily(int fontid);
int GetFontId(const char *name);
char* GetFontName(int fontid);
int GetNewFontId(void);
char* GetPostScriptName(int fontid, int weight, int style);
char* GetScreenName(int fontid, int weight, int style);
class wxHashTable *table;
int nextFontId;
};
extern wxFontNameDirectory wxTheFontNameDirectory;
#endif // __GTKFONTH__

90
include/wx/gtk/frame.h Normal file
View File

@@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////
// Name: frame.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKFRAMEH__
#define __GTKFRAMEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/window.h"
#include "wx/menu.h"
#include "wx/statusbr.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxRadioBox;
class wxFrame;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxFrameNameStr;
//-----------------------------------------------------------------------------
// wxFrame
//-----------------------------------------------------------------------------
class wxFrame: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxFrame)
public:
wxFrame(void);
wxFrame( wxWindow *parent, const wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
bool Create( wxWindow *parent, const wxWindowID id, const wxString &title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
~wxFrame(void);
bool Destroy(void);
void OnCloseWindow( wxCloseEvent& event );
virtual bool Show( const bool show );
virtual void Enable( const bool enable );
virtual void GetClientSize( int *width, int *height ) const;
void OnSize( wxSizeEvent &event );
void SetMenuBar( wxMenuBar *menuBar );
virtual bool CreateStatusBar( const int number = 1 );
virtual void SetStatusText( const wxString &text, const int number = 0 );
virtual void SetStatusWidths( const int n, const int *width );
wxStatusBar *GetStatusBar(void);
wxMenuBar *GetMenuBar(void);
void SetTitle( const wxString &title );
wxString GetTitle(void) const;
void OnActivate( wxActivateEvent &WXUNUSED(event) ) {};
void GtkOnSize( int width, int height );
private:
friend wxWindow;
GtkWidget *m_mainWindow;
wxMenuBar *m_frameMenuBar;
wxStatusBar *m_frameStatusBar;
bool m_doingOnSize;
wxString m_title;
DECLARE_EVENT_TABLE()
};
#endif // __GTKFRAMEH__

34
include/wx/gtk/gauge.h Normal file
View File

@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gauge.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKGAUGEH__
#define __GTKGAUGEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxGauge;
//-----------------------------------------------------------------------------
// wxGaugeBox
//-----------------------------------------------------------------------------
#endif // __GTKGAUGEH__

37
include/wx/gtk/gdiobj.h Normal file
View File

@@ -0,0 +1,37 @@
/////////////////////////////////////////////////////////////////////////////
// Name: gdiobj.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GDIOBJH__
#define __GDIOBJH__
#include "wx/object.h"
#ifdef __GNUG__
#pragma interface
#endif
class WXDLLEXPORT wxGDIObject: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxGDIObject)
public:
inline wxGDIObject(void) { m_visible = FALSE; };
inline ~wxGDIObject(void) {};
virtual bool GetVisible(void) { return m_visible; }
virtual void SetVisible(bool v) { m_visible = v; }
protected:
bool m_visible; // Can a pointer to this object be safely taken?
// - only if created within FindOrCreate...
};
#endif
// __GDIOBJH__

53
include/wx/gtk/icon.h Normal file
View File

@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKICONH__
#define __GTKICONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxIcon;
//-----------------------------------------------------------------------------
// wxIcon
//-----------------------------------------------------------------------------
class wxIcon: public wxBitmap
{
DECLARE_DYNAMIC_CLASS(wxIcon)
public:
wxIcon(void) {};
inline wxIcon(const wxIcon& icon) { Ref(icon); }
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
wxIcon( char **bits, const int WXUNUSED(width), const int WXUNUSED(height) ) :
wxBitmap( bits ) {};
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
};
#endif // __GTKICONH__

85
include/wx/gtk/listbox.h Normal file
View File

@@ -0,0 +1,85 @@
/////////////////////////////////////////////////////////////////////////////
// Name: listbox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKLISTBOXH__
#define __GTKLISTBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxListBox;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxListBoxNameStr;
//-----------------------------------------------------------------------------
// wxListBox
//-----------------------------------------------------------------------------
class wxListBox: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxListBox)
public:
wxListBox(void);
wxListBox( wxWindow *parent, wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxListBoxNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const long style = 0, const wxString &name = wxListBoxNameStr );
void Append( const wxString &item );
void Append( const wxString &item, char *clientData );
void Clear(void);
void Delete( int n );
void Deselect( int n );
int FindString( const wxString &item ) const;
char *GetClientData( const int n ) const;
int GetSelection(void) const;
int GetSelections( int **selections ) const;
wxString GetString( int n ) const;
wxString GetStringSelection(void) const;
int Number(void);
bool Selected( const int n );
void Set( const int n, const wxString *choices );
void SetClientData( const int n, char *clientData );
void SetFirstItem( int n );
void SetFirstItem( const wxString &item );
void SetSelection( const int n, const bool select = TRUE );
void SetString( const int n, const wxString &string );
void SetStringSelection( const wxString &string, const bool select = TRUE );
private:
GtkList *m_list;
public:
int GetIndex( GtkWidget *item ) const;
};
#endif // __GTKLISTBOXH__

146
include/wx/gtk/mdi.h Normal file
View File

@@ -0,0 +1,146 @@
/////////////////////////////////////////////////////////////////////////////
// Name: mdi.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __MDIH__
#define __MDIH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/panel.h"
#include "wx/frame.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMDIParentFrame;
class wxMDIClientWindow;
class wxMDIChildFrame;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char* wxFrameNameStr;
extern const char* wxStatusLineNameStr;
//-----------------------------------------------------------------------------
// wxMDIParentFrame
//-----------------------------------------------------------------------------
class wxMDIParentFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
friend class wxMDIChildFrame;
public:
wxMDIParentFrame(void);
wxMDIParentFrame( wxWindow *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr );
~wxMDIParentFrame(void);
bool Create( wxWindow *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr );
void OnSize( wxSizeEvent& event );
void OnActivate( wxActivateEvent& event );
void SetMenuBar( wxMenuBar *menu_bar );
void GetClientSize(int *width, int *height) const;
wxMDIChildFrame *GetActiveChild(void) const;
wxMDIClientWindow *GetClientWindow(void) const;
virtual wxMDIClientWindow *OnCreateClient(void);
virtual void Cascade(void) {};
virtual void Tile(void) {};
virtual void ArrangeIcons(void) {};
virtual void ActivateNext(void);
virtual void ActivatePrevious(void);
void OnSysColourChanged(wxSysColourChangedEvent& event);
protected:
wxMDIClientWindow * m_clientWindow;
wxMDIChildFrame * m_currentChild;
bool m_parentFrameActive;
// DECLARE_EVENT_TABLE()
};
//-----------------------------------------------------------------------------
// wxMDIChildFrame
//-----------------------------------------------------------------------------
class wxMDIChildFrame: public wxPanel
{
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
public:
wxMDIChildFrame(void);
wxMDIChildFrame( wxMDIParentFrame *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
~wxMDIChildFrame(void);
bool Create( wxMDIParentFrame *parent,
const wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
void SetMenuBar( wxMenuBar *menu_bar );
// no status bars in wxGTK
virtual bool CreateStatusBar( const int WXUNUSED(number) = 1 ) { return FALSE; };
virtual void SetStatusText( const wxString &WXUNUSED(text), const int WXUNUSED(number) ) {};
virtual void SetStatusWidths( const int WXUNUSED(n), const int *WXUNUSED(width) ) {};
virtual void Maximize(void) {};
virtual void Restore(void) {};
virtual void Activate(void);
public:
wxString m_title;
};
//-----------------------------------------------------------------------------
// wxMDIClientWindow
//-----------------------------------------------------------------------------
class wxMDIClientWindow: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
public:
wxMDIClientWindow(void);
wxMDIClientWindow( wxMDIParentFrame *parent, const long style = 0 );
~wxMDIClientWindow(void);
virtual bool CreateClient( wxMDIParentFrame *parent, const long style = wxVSCROLL | wxHSCROLL );
void AddChild( wxWindow *child );
};
#endif // __MDIH__

107
include/wx/gtk/menu.h Normal file
View File

@@ -0,0 +1,107 @@
/////////////////////////////////////////////////////////////////////////////
// Name: menu.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKMENUH__
#define __GTKMENUH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMenuBar;
class wxMenuItem;
class wxMenu;
//-----------------------------------------------------------------------------
// wxMenuBar
//-----------------------------------------------------------------------------
class wxMenuBar: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxMenuBar)
public:
wxMenuBar(void);
void Append( wxMenu *menu, const wxString &title );
int FindMenuItem( const wxString &menuString, const wxString &itemString ) const;
wxList m_menus;
GtkWidget *m_menubar;
};
//-----------------------------------------------------------------------------
// wxMenu
//-----------------------------------------------------------------------------
class wxMenuItem: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxMenuItem)
public:
wxMenuItem(void);
int m_id;
wxString m_text;
bool m_isCheckMenu;
bool m_checked;
bool m_isSubMenu;
bool m_isEnabled;
wxMenu *m_subMenu;
wxString m_helpStr;
GtkWidget *m_menuItem; // GtkMenuItem
};
class wxMenu: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxMenu)
public:
wxMenu( const wxString &title = "" );
void AppendSeparator(void);
void Append( const int id, const wxString &item,
const wxString &helpStr = "", const bool checkable = FALSE );
void Append( const int id, const wxString &item,
wxMenu *subMenu, const wxString &helpStr = "" );
int FindItem( const wxString itemString ) const;
void Break(void) {};
void Enable( const int id, const bool enable );
bool Enabled( const int id ) const;
void SetLabel( const int id, const wxString &label );
public:
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;
void SetInvokingWindow( wxWindow *win );
wxWindow *GetInvokingWindow(void);
wxString m_title;
wxList m_items;
wxWindow *m_invokingWindow;
GtkWidget *m_menu; // GtkMenu
};
#endif // __GTKMENUH__

60
include/wx/gtk/palette.h Normal file
View File

@@ -0,0 +1,60 @@
/////////////////////////////////////////////////////////////////////////////
// Name: palette.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKPALETTEH__
#define __GTKPALETTEH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxPalette;
//-----------------------------------------------------------------------------
// wxPalette
//-----------------------------------------------------------------------------
class wxPalette: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxPalette)
public:
wxPalette(void);
wxPalette( const int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
wxPalette( const wxPalette& palette );
wxPalette( const wxPalette* palette );
~wxPalette(void);
wxPalette& operator = ( const wxPalette& palette );
bool operator == ( const wxPalette& palette );
bool operator != ( const wxPalette& palette );
bool Ok(void) const;
bool Create( const int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
int GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const;
bool GetRGB( const int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const;
// no data
};
#define wxColorMap wxPalette
#define wxColourMap wxPalette
#endif // __GTKPALETTEH__

68
include/wx/gtk/pen.h Normal file
View File

@@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pen.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKPENH__
#define __GTKPENH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxPen;
//-----------------------------------------------------------------------------
// wxPen
//-----------------------------------------------------------------------------
class wxPen: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxPen)
public:
wxPen(void);
wxPen( const wxColour &colour, int width, int style );
wxPen( const wxString &colourName, int width, int style );
wxPen( const wxPen& pen );
wxPen( const wxPen* pen );
~wxPen(void);
wxPen& operator = ( const wxPen& pen );
bool operator == ( const wxPen& pen );
bool operator != ( const wxPen& pen );
void SetColour( const wxColour &colour );
void SetColour( const wxString &colourName );
void SetColour( const int red, const int green, const int blue );
void SetCap( int capStyle );
void SetJoin( int joinStyle );
void SetStyle( int style );
void SetWidth( int width );
wxColour &GetColour(void) const;
int GetCap(void) const;
int GetJoin(void) const;
int GetStyle(void) const;
int GetWidth(void) const;
bool Ok(void) const;
// no data :-)
};
#endif // __GTKPENH__

84
include/wx/gtk/radiobox.h Normal file
View File

@@ -0,0 +1,84 @@
/////////////////////////////////////////////////////////////////////////////
// Name: radiobox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKRADIOBOXH__
#define __GTKRADIOBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/bitmap.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxRadioBox;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxRadioBoxNameStr;
//-----------------------------------------------------------------------------
// wxRadioBox
//-----------------------------------------------------------------------------
class wxRadioBox: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxRadioBox)
public:
wxRadioBox(void);
wxRadioBox( wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
const wxString &name = wxRadioBoxNameStr );
bool Create( wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int n = 0, const wxString choices[] = NULL,
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
const wxString &name = wxRadioBoxNameStr );
int FindString( const wxString& s) const;
void SetSelection( const int n );
int GetSelection(void) const;
wxString GetString( const int n ) const;
wxString GetLabel(void) const;
void SetLabel( const wxString& label );
void SetLabel( const int item, const wxString& label );
void SetLabel( const int item, wxBitmap *bitmap );
wxString GetLabel( const int item ) const;
bool Show( const bool show );
void Enable( const bool enable );
void Enable( const int item, const bool enable );
void Show( const int item, const bool show );
virtual wxString GetStringSelection(void) const;
virtual bool SetStringSelection( const wxString& s );
virtual int Number(void) const;
int GetNumberOfRowsOrCols(void) const;
void SetNumberOfRowsOrCols( const int n );
private:
GtkRadioButton *m_radio;
};
#endif // __GTKRADIOBOXH__

31
include/wx/gtk/radiobut.h Normal file
View File

@@ -0,0 +1,31 @@
/////////////////////////////////////////////////////////////////////////////
// Name: radiobut.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKRADIOBUTTONH__
#define __GTKRADIOBUTTONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxRadioButton;
#endif // __GTKRADIOBUTTONH__

99
include/wx/gtk/region.h Normal file
View File

@@ -0,0 +1,99 @@
/////////////////////////////////////////////////////////////////////////////
// Name: region.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __REGIONH__
#define __REGIONH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/list.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxRegion;
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
enum wxRegionContain
{
wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
};
// So far, for internal use only
enum wxRegionOp {
wxRGN_AND, // Creates the intersection of the two combined regions.
wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1.
wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
wxRGN_OR, // Creates the union of two combined regions.
wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
};
//-----------------------------------------------------------------------------
// wxRegion
//-----------------------------------------------------------------------------
class wxRegion : public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxRegion);
public:
wxRegion( long x, long y, long w, long h );
wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
wxRegion( const wxRect& rect );
wxRegion(void);
~wxRegion(void);
inline wxRegion( const wxRegion& r )
{ Ref(r); }
inline wxRegion& operator = ( const wxRegion& r )
{ Ref(r); return (*this); }
void Clear(void);
bool Union( long x, long y, long width, long height );
bool Union( const wxRect& rect );
bool Union( const wxRegion& region );
bool Intersect( long x, long y, long width, long height );
bool Intersect( const wxRect& rect );
bool Intersect( const wxRegion& region );
bool Subtract( long x, long y, long width, long height );
bool Subtract( const wxRect& rect );
bool Subtract( const wxRegion& region );
bool Xor( long x, long y, long width, long height );
bool Xor( const wxRect& rect );
bool Xor( const wxRegion& region );
void GetBox( long& x, long& y, long&w, long &h ) const;
wxRect GetBox(void) const ;
bool Empty(void) const;
wxRegionContain Contains( long x, long y ) const;
wxRegionContain Contains( long x, long y, long w, long h ) const;
public:
GdkRegion *GetRegion(void) const;
};
#endif
// __REGIONH__

82
include/wx/gtk/scrolbar.h Normal file
View File

@@ -0,0 +1,82 @@
/////////////////////////////////////////////////////////////////////////////
// Name: scrolbar.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKSCROLLBARH__
#define __GTKSCROLLBARH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxScrollBar;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxScrollBarNameStr;
//-----------------------------------------------------------------------------
// wxScrollBar
//-----------------------------------------------------------------------------
class wxScrollBar: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxScrollBar)
public:
wxScrollBar(void) { m_adjust = NULL; m_oldPos = 0.0; };
wxScrollBar(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxSB_HORIZONTAL,
const wxString& name = wxScrollBarNameStr );
~wxScrollBar(void);
bool Create(wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxSB_HORIZONTAL,
const wxString& name = wxScrollBarNameStr);
int GetPosition(void) const;
int GetThumbSize() const;
int GetPageSize() const;
int GetRange() const;
virtual void SetPosition( const int viewStart );
virtual void SetScrollbar( const int position, const int thumbSize, const int range, const int pageSize,
const bool refresh = TRUE );
// Backward compatibility
int GetValue(void) const;
void SetValue( const int viewStart );
void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
int GetViewLength() const;
int GetObjectLength() const;
void SetPageSize( const int pageLength );
void SetObjectLength( const int objectLength );
void SetViewLength( const int viewLength );
public:
GtkAdjustment *m_adjust;
float m_oldPos;
};
#endif
// __GTKSCROLLBARH__

40
include/wx/gtk/settings.h Normal file
View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////
// Name: settings.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKSETTINGSH__
#define __GTKSETTINGSH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/gdicmn.h"
#include "wx/pen.h"
#include "wx/font.h"
class WXDLLEXPORT wxSystemSettings: public wxObject
{
public:
inline wxSystemSettings(void) {}
// Get a system colour
static wxColour GetSystemColour(int index);
// Get a system font
static wxFont GetSystemFont(int index);
// Get a system metric, e.g. scrollbar size
static int GetSystemMetric(int index);
};
#endif
// __GTKSETTINGSH__

534
include/wx/gtk/setup.h Normal file
View File

@@ -0,0 +1,534 @@
/* include/wx/gtk/setup.h. Generated automatically by configure. */
/* wx_setup.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
#ifndef __GTKSETUPH__
#define __GTKSETUPH__
#ifdef __GNUG__
#pragma interface
#endif
/* define the system to compile */
#define __GTK__ 1
#define __UNIX__ 1
#define __LINUX__ 1
/* #undef __SGI__ */
/* #undef __HPUX__ */
/* #undef __SYSV__ */
/* #undef __SVR4__ */
/* #undef __AIX__ */
/* #undef __SUN__ */
/* #undef __SOLARIS__ */
/* #undef __SUNOS__ */
/* #undef __ALPHA__ */
/* #undef __OSF__ */
/* #undef __BSD__ */
/* #undef __FREEBSD__ */
/* #undef __VMS__ */
/* #undef __ULTRIX__ */
/* #undef __DATA_GENERAL__ */
/*
* Use zlib
*/
#define USE_ZLIB 1
/*
* Use gdk_imlib
*/
#define USE_GDK_IMLIB 1
/*
* Use libpng
*/
#define USE_LIBPNG 1
/*
* Use Threads
*/
/* #undef USE_THREADS */
/* #undef USE_THREADS_POSIX */
/* #undef USE_THREADS_SGI */
/*
* Use storable classes
*/
#define USE_STORABLE_CLASSES 1
/*
* Use automatic translation via gettext() in wxTString
*/
#define USE_AUTOTRANS 1
/*
* Use font metric files in GetTextExtent for wxPostScriptDC
* Use consistent PostScript fonts for AFM and printing (!)
*/
#define USE_AFM_FOR_POSTSCRIPT 1
#define WX_NORMALIZED_PS_FONTS 1
/*
* Use clipboard
*/
/* #undef USE_CLIPBOARD */
/*
* Use wxWindows layout constraint system
*/
#define USE_CONSTRAINTS 1
/*
* Use the document/view architecture
*/
#define USE_DOC_VIEW_ARCHITECTURE 1
/*
* Use enhanced dialog
*/
/* #undef USE_ENHANCED_DIALOG */
/*
* Use Form panel item placement
*/
/* #undef USE_FORM */
/*
* Use fraction class
*/
#define USE_FRACTION 1
/*
* Use gauge item
*/
#define USE_GAUGE 1
/*
* Implement a GLCanvas class as an interface to OpenGL, using the GLX
* extension to the X11 protocol. You can use the (free) Mesa library
* if you don't have a 'real' OpenGL.
*/
#define USE_GLX 0
/*
* Use wxWindows help facility (needs USE_IPC 1)
*/
/* #undef USE_HELP */
/*
* Use iostream.h rather than iostream
*/
#define USE_IOSTREAMH 1
/*
* Use Interprocess communication
*/
#define USE_IPC 1
/*
* Use Metafile and Metafile device context
*/
/* #undef USE_METAFILE */
/*
* Use PostScript device context
*/
#define USE_POSTSCRIPT 1
/*
* Use the print/preview architecture
*/
#define USE_PRINTING_ARCHITECTURE 1
/*
* Use Prolog IO
*/
/* #undef USE_PROLOGIO */
/*
* Use Remote Procedure Call (Needs USE_IPC and USE_PROLOGIO)
*/
/* #undef USE_RPC */
/*
* Use wxGetResource & wxWriteResource (change .Xdefaults)
*/
#define USE_RESOURCES 1
/*
* Use scrollbar item
*/
#define USE_SCROLLBAR 1
/*
* Use time and date classes
*/
#define USE_TIMEDATE 1
/*
* Use toolbar, use Xt port toolbar (3D look)
*/
#define USE_TOOLBAR 1
#define USE_XT_TOOLBAR
/*
* Enables old type checking mechanism (wxSubType)
*/
/* #undef USE_TYPETREE */
/*
* Use virtual list box item
*/
/* #undef USE_VLBOX */
/*
* Use wxWindows resource loading (.wxr-files) (Needs USE_PROLOGIO 1)
*/
#define USE_WX_RESOURCES 1
/*
* Use wxGraph
*/
/* #undef USE_WXGRAPH */
/*
* Use wxTree
*/
/********************** DO NOT CHANGE BELOW THIS POINT **********************/
/**************************** DEBUGGING FEATURES ****************************/
/* Compatibility with 1.66 API.
Level 0: no backward compatibility, all new features
Level 1: wxDC, OnSize (etc.) compatibility, but
some new features such as event tables */
#define WXWIN_COMPATIBILITY 1
/*
* Enables debugging: memory tracing, assert, etc.
*/
/* #undef DEBUG */
/*
* Enables debugging version of wxObject::new and wxObject::delete (IF DEBUG)
* WARNING: this code may not work with all architectures, especially
* if alignment is an issue.
*/
/* #undef USE_MEMORY_TRACING */
/*
* Enable debugging version of global memory operators new and delete
* Disable it, If this causes problems (e.g. link errors)
*/
/* #undef USE_GLOBAL_MEMORY_OPERATORS */
/*
* If WXDEBUG && USE_MEMORY_TRACING && USE_GLOBAL_MEMORY_OPERATORS
* used to debug the memory allocation of wxWindows Xt port code
*/
#define USE_INTERNAL_MEMORY_TRACING 0
/*
* Matthews garbage collection (used for MrEd?)
*/
#define WXGARBAGE_COLLECTION_ON 0
/**************************** COMPILER FEATURES *****************************/
/*
* Disable this if your compiler can't cope
* with omission of prototype parameters.
*/
#define REMOVE_UNUSED_ARG 1
/*
* The const keyword is being introduced more in wxWindows.
* You can use this setting to maintain backward compatibility.
* If 0: will use const wherever possible.
* If 1: will use const only where necessary
* for precompiled headers to work.
* If 2: will be totally backward compatible, but precompiled
* headers may not work and program size will be larger.
*/
#define CONST_COMPATIBILITY 0
/************************ WINDOWS 3.1 COMPATIBILITY *************************/
/*
* Normalize X drawing code to behave exactly as MSW.
*/
#define WX_STANDARD_GRAPHICS 0
/******************* other stuff **********************************/
/*
* Support image loading for wxBitmap (wxImage is needed for this)
*/
#define USE_IMAGE_LOADING 0
#define WXIMAGE_INCLUDE "../../utils/image/src/wx_image.h"
/*
* Use splines
*/
#define USE_SPLINES 1
/*
* USE_DYNAMIC_CLASSES is TRUE for the Xt port
*/
#define USE_DYNAMIC_CLASSES 1
/*
* USE_EXTENDED_STATICS is FALSE for the Xt port
*/
#define USE_EXTENDED_STATICS 0
/*************************** IMAKEFILE EVALUATIOS ***************************/
#if USE_XPM
#define USE_XPM_IN_X 1
#else
#define USE_XPM_IN_X 0
#endif
#if USE_IMAGE_LOADING
#define USE_IMAGE_LOADING_IN_X 1
#else
#define USE_IMAGE_LOADING_IN_X 0
#endif
/* here comes the system-specific stuff */
/* acconfig.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define if type char is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
/* #undef __CHAR_UNSIGNED__ */
#endif
/* Define if the closedir function returns void instead of int. */
/* #undef CLOSEDIR_VOID */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* #undef CRAY_STACKSEG_END */
/* Define for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
/* Define if you have <dirent.h>. */
/* #undef DIRENT */
/* Define to the type of elements in the array set by `getgroups'.
Usually this is either `int' or `gid_t'. */
#define GETGROUPS_T gid_t
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
/* Define if the `getpgrp' function takes no argument. */
/* #undef GETPGRP_VOID */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if you have alloca, as a function or macro. */
/* #undef HAVE_ALLOCA */
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
/* Define if your system has its own `getloadavg' function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */
/* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */
#define HAVE_LONG_DOUBLE 1
/* Define if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption
by a signal. */
/* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */
#define HAVE_ST_BLKSIZE 1
/* Define if your struct stat has st_blocks. */
#define HAVE_ST_BLOCKS 1
/* Define if you have the strcoll function and it is properly defined. */
/* #undef HAVE_STRCOLL */
/* Define if your struct stat has st_rdev. */
#define HAVE_ST_RDEV 1
/* Define if you have the strftime function. */
/* #undef HAVE_STRFTIME */
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1
/* Define if your struct tm has tm_zone. */
/* #undef HAVE_TM_ZONE */
/* Define if you don't have tm_zone but do have the external array
tzname. */
#define HAVE_TZNAME 1
/* Define if you have <unistd.h>. */
/* #undef HAVE_UNISTD_H */
/* Define if utime(file, NULL) sets file's timestamp to the present. */
/* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */
/* #undef HAVE_VPRINTF */
/* Define if you have the wait3 system call. */
/* #undef HAVE_WAIT3 */
/* Define as __inline if that's what the C compiler calls it. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define if major, minor, and makedev are declared in <mkdev.h>. */
/* #undef MAJOR_IN_MKDEV */
/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
/* #undef MAJOR_IN_SYSMACROS */
/* Define if on MINIX. */
/* #undef _MINIX */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef mode_t */
/* Define if you don't have <dirent.h>, but have <ndir.h>. */
/* #undef NDIR */
/* Define if you have <memory.h>, and <string.h> doesn't declare the
mem* functions. */
/* #undef NEED_MEMORY_H */
/* Define if your struct nlist has an n_un member. */
/* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */
/* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V
before release 3. */
/* #undef SETVBUF_REVERSED */
/* Define SIZESOF for some Objects */
#define SIZEOF_INT 4
#define SIZEOF_INT_P 4
#define SIZEOF_LONG 4
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
/* #undef STACK_DIRECTION */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define on System V Release 4. */
/* #undef SVR4 */
/* Define on BSD */
/* #undef BSD */
/* Define on System V */
/* #undef SYSV */
/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
/* #undef SYSDIR */
/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
/* #undef SYSNDIR */
/* Define if `sys_siglist' is declared by <signal.h>. */
/* #undef SYS_SIGLIST_DECLARED */
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define if your <sys/time.h> declares struct tm. */
/* #undef TM_IN_SYS_TIME */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define for Encore UMAX. */
/* #undef UMAX */
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */
/* #undef UMAX4_3 */
/* Define if you do not have <strings.h>, index, bzero, etc.. */
/* #undef USG */
/* Define if the system is System V Release 4 */
/* #undef SVR4 */
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Define if the closedir function returns void instead of int. */
/* #undef VOID_CLOSEDIR */
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* Define if lex declares yytext as a char * by default, not a char[]. */
#define YYTEXT_POINTER 1
#endif /* __GTKSETUPH__ */
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */

91
include/wx/gtk/slider.h Normal file
View File

@@ -0,0 +1,91 @@
/////////////////////////////////////////////////////////////////////////////
// Name: slider.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKSLIDERH__
#define __GTKSLIDERH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxSlider;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxSliderNameStr;
//-----------------------------------------------------------------------------
// wxSlider
//-----------------------------------------------------------------------------
class wxSlider: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxSlider)
public:
wxSlider(void);
wxSlider( wxWindow *parent, const wxWindowID id,
const int value, const int minValue, const int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxSL_HORIZONTAL,
/* const wxValidator& validator = wxDefaultValidator, */
const wxString& name = wxSliderNameStr);
~wxSlider(void);
bool Create(wxWindow *parent, const wxWindowID id,
const int value, const int minValue, const int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const long style = wxSL_HORIZONTAL,
/* const wxValidator& validator = wxDefaultValidator, */
const wxString& name = wxSliderNameStr);
virtual int GetValue(void) const;
virtual void SetValue( const int );
void GetSize( int *x, int *y ) const;
void SetSize( const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO );
void GetPosition( int *x, int *y ) const;
void SetRange( const int minValue, const int maxValue );
int GetMin(void) const;
int GetMax(void) const;
void SetTickFreq( const int n, const int pos );
int GetTickFreq(void) const;
void SetPageSize( const int pageSize );
int GetPageSize(void) const;
void ClearSel(void);
void ClearTicks(void);
void SetLineSize( const int lineSize );
int GetLineSize(void) const;
int GetSelEnd(void) const;
int GetSelStart(void) const;
void SetSelection( const int minPos, const int maxPos );
void SetThumbLength( const int len );
int GetThumbLength(void) const;
void SetTick( const int tickPos );
public:
GtkAdjustment *m_adjust;
float m_oldPos;
};
#endif // __GTKSLIDERH__

34
include/wx/gtk/statbmp.h Normal file
View File

@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: statbmp.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKSTATICBITMAPH__
#define __GTKSTATICBITMAPH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxStaticBitmap;
//-----------------------------------------------------------------------------
// wxStaticBitmap
//-----------------------------------------------------------------------------
#endif // __GTKSTATICBITMAPH__

55
include/wx/gtk/statbox.h Normal file
View File

@@ -0,0 +1,55 @@
/////////////////////////////////////////////////////////////////////////////
// Name: stabox.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKSTATICBOXH__
#define __GTKSTATICBOXH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxStaticBox;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxStaticBoxNameStr;
//-----------------------------------------------------------------------------
// wxStaticBox
//-----------------------------------------------------------------------------
class wxStaticBox: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxStaticBox)
public:
wxStaticBox(void);
wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxStaticBoxNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxStaticBoxNameStr );
};
#endif // __GTKSTATICBOXH__

57
include/wx/gtk/stattext.h Normal file
View File

@@ -0,0 +1,57 @@
/////////////////////////////////////////////////////////////////////////////
// Name: stattext.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKSTATICTEXTH__
#define __GTKSTATICTEXTH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxStaticText;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxStaticTextNameStr;
//-----------------------------------------------------------------------------
// wxStaticText
//-----------------------------------------------------------------------------
class wxStaticText: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxStaticText)
public:
wxStaticText(void);
wxStaticText( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxStaticTextNameStr );
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const long style = 0, const wxString &name = wxStaticTextNameStr );
wxString GetLabel(void) const;
void SetLabel( const wxString &label );
};
#endif // __GTKSTATICTEXTH__

139
include/wx/gtk/tbargtk.h Normal file
View File

@@ -0,0 +1,139 @@
/////////////////////////////////////////////////////////////////////////////
// Name: tbargtk.h
// Purpose: GTK toolbar
// Author: Robert Roebling
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __TBARGTKH__
#define __TBARGTKH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/control.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxToolBarTool;
class wxToolBarGTK;
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define wxTOOL_STYLE_BUTTON 1
#define wxTOOL_STYLE_SEPARATOR 2
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxToolBarNameStr;
//-----------------------------------------------------------------------------
// wxToolBarTool
//-----------------------------------------------------------------------------
class wxToolBarTool: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxToolBarTool)
public:
wxToolBarTool(void) {};
wxToolBarTool( wxToolBarGTK *owner, const int theIndex = 0,
const wxBitmap& bitmap1 = wxNullBitmap, const wxBitmap& bitmap2 = wxNullBitmap,
const bool toggle = FALSE, wxObject *clientData = NULL,
const wxString& shortHelpString = "", const wxString& longHelpString = "");
~wxToolBarTool(void);
public:
int m_toolStyle;
wxObject *m_clientData;
int m_index;
bool m_toggleState;
bool m_isToggle;
bool m_deleteSecondBitmap;
bool m_enabled;
wxBitmap m_bitmap1;
wxBitmap m_bitmap2;
bool m_isMenuCommand;
wxString m_shortHelpString;
wxString m_longHelpString;
wxToolBarGTK *m_owner;
};
//-----------------------------------------------------------------------------
// wxToolBarGTK
//-----------------------------------------------------------------------------
class wxToolBarGTK: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxToolBarGTK)
public:
wxToolBarGTK(void);
wxToolBarGTK( wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = 0, const wxString& name = wxToolBarNameStr );
~wxToolBarGTK(void);
bool Create( wxWindow *parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
const long style = 0, const wxString& name = wxToolBarNameStr);
// Only allow toggle if returns TRUE. Call when left button up.
virtual bool OnLeftClick(int toolIndex, bool toggleDown);
// Call when right button down.
virtual void OnRightClick(int toolIndex, float x, float y);
// Called when the mouse cursor enters a tool bitmap.
// Argument is -1 if mouse is exiting the toolbar.
virtual void OnMouseEnter(int toolIndex);
// If pushedBitmap is NULL, a reversed version of bitmap is
// created and used as the pushed/toggled image.
// If toggle is TRUE, the button toggles between the two states.
virtual wxToolBarTool *AddTool( const int toolIndex, const wxBitmap& bitmap,
const wxBitmap& pushedBitmap = wxNullBitmap, const bool toggle = FALSE,
const float xPos = -1, const float yPos = -1, wxObject *clientData = NULL,
const wxString& helpString1 = "", const wxString& helpString2 = "");
virtual void AddSeparator(void);
virtual void ClearTools(void);
virtual void EnableTool(const int toolIndex, const bool enable);
virtual void ToggleTool(const int toolIndex, const bool toggle); // toggle is TRUE if toggled on
virtual void SetToggle(const int toolIndex, const bool toggle); // Set this to be togglable (or not)
virtual wxObject *GetToolClientData(const int index) const;
virtual bool GetToolState(const int toolIndex) const;
virtual bool GetToolEnabled(const int toolIndex) const;
virtual void SetMargins(const int x, const int y);
void SetMargins(const wxSize& size) { SetMargins(size.x, size.y); };
virtual void SetToolPacking(const int packing);
virtual void SetToolSeparation(const int separation);
public:
GtkToolbar *m_toolbar;
wxList m_tools;
DECLARE_EVENT_TABLE()
};
#endif
// __TBARGTKH__

106
include/wx/gtk/textctrl.h Normal file
View File

@@ -0,0 +1,106 @@
/////////////////////////////////////////////////////////////////////////////
// Name: textctrl.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKTEXTCTRLH__
#define __GTKTEXTCTRLH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/control.h"
#if USE_IOSTREAMH
#include <iostream.h>
#else
#include <iostream>
#endif
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxTextCtrl;
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
extern const char *wxTextCtrlNameStr;
//-----------------------------------------------------------------------------
// wxTextCtrl
//-----------------------------------------------------------------------------
class wxTextCtrl: public wxControl, public streambuf
{
DECLARE_DYNAMIC_CLASS(wxTextCtrl);
public:
wxTextCtrl(void);
wxTextCtrl( wxWindow *parent, const wxWindowID id, const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int style = 0, const wxString &name = wxTextCtrlNameStr );
bool Create( wxWindow *parent, const wxWindowID id, const wxString &value = "",
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
const int style = 0, const wxString &name = wxTextCtrlNameStr );
wxString GetValue(void) const;
void SetValue( const wxString &value );
void WriteText( const wxString &text );
/*
wxString GetLineText( const long lineNo ) const;
bool LoadFile( const wxString &file );
bool SaveFile( const wxString &file );
void DiscardEdits(void);
bool IsModified(void);
void OnDropFiles( wxDropFilesEvent &event );
long PositionToXY( const long pos, long *x, long *y ) const;
long XYToPosition( const long x, const long y );
int GetNumberOfLines(void);
*/
virtual void SetInsertionPoint( const long pos );
virtual void SetInsertionPointEnd(void);
virtual void SetEditable( const bool editable );
virtual void SetSelection( const long from, const long to );
void ShowPosition( const long pos );
virtual long GetInsertionPoint(void) const;
virtual long GetLastPosition(void) const;
virtual void Remove( const long from, const long to );
virtual void Replace( const long from, const long to, const wxString &value );
void Cut(void);
void Copy(void);
void Paste(void);
void Delete(void);
void OnChar( wxKeyEvent &event );
int overflow(int i);
int sync(void);
int underflow(void);
wxTextCtrl& operator<<(const wxString& s);
wxTextCtrl& operator<<(const int i);
wxTextCtrl& operator<<(const long i);
wxTextCtrl& operator<<(const float f);
wxTextCtrl& operator<<(const double d);
wxTextCtrl& operator<<(const char c);
DECLARE_EVENT_TABLE()
};
#endif // __GTKTEXTCTRLH__

53
include/wx/gtk/timer.h Normal file
View File

@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////
// Name: timer.h
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKTIMERH__
#define __GTKTIMERH__
#ifdef __GNUG__
#pragma interface
#endif
#include "wx/defs.h"
#include "wx/object.h"
//-----------------------------------------------------------------------------
// derived classes
//-----------------------------------------------------------------------------
class wxTimer;
//-----------------------------------------------------------------------------
// wxTimer
//-----------------------------------------------------------------------------
class wxTimer: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxTimer)
public:
wxTimer(void);
~wxTimer(void);
int Interval(void);
bool OneShot(void);
virtual void Notify(void);
void Start( int millisecs = -1, bool oneShot = FALSE );
void Stop(void);
private:
int m_tag;
int m_time;
bool m_oneShot;
};
#endif // __GTKTIMERH__

75
include/wx/gtk/win_gtk.h Normal file
View File

@@ -0,0 +1,75 @@
/////////////////////////////////////////////////////////////////////////////
// Name: win_gtk.h
// Purpose: wxWindows's GTK base widget
// Author: Robert Roebling
// Created: 01/02/97
// Id:
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTK_MYFIXED_H__
#define __GTK_MYFIXED_H__
#include <gdk/gdk.h>
#include <gtk/gtkcontainer.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_MYFIXED(obj) GTK_CHECK_CAST (obj, gtk_myfixed_get_type (), GtkMyFixed)
#define GTK_MYFIXED_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_myfixed_get_type (), GtkMyFixedClass)
#define GTK_IS_MYFIXED(obj) GTK_CHECK_TYPE (obj, gtk_myfixed_get_type ())
typedef struct _GtkMyFixed GtkMyFixed;
typedef struct _GtkMyFixedClass GtkMyFixedClass;
typedef struct _GtkMyFixedChild GtkMyFixedChild;
struct _GtkMyFixed
{
GtkContainer container;
GList *children;
gint16 scroll_offset_x;
gint16 scroll_offset_y;
};
struct _GtkMyFixedClass
{
GtkContainerClass parent_class;
};
struct _GtkMyFixedChild
{
GtkWidget *widget;
gint16 x;
gint16 y;
};
guint gtk_myfixed_get_type (void);
GtkWidget* gtk_myfixed_new (void);
void gtk_myfixed_set_offset (GtkMyFixed *myfixed,
gint16 x,
gint16 y);
void gtk_myfixed_put (GtkMyFixed *myfixed,
GtkWidget *widget,
gint16 x,
gint16 y);
void gtk_myfixed_move (GtkMyFixed *myfixed,
GtkWidget *widget,
gint16 x,
gint16 y);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_MYFIXED_H__ */

Some files were not shown because too many files have changed in this diff Show More