This commit is contained in:
nephacks
2025-06-04 03:22:50 +02:00
parent f234f23848
commit f12416cffd
14243 changed files with 6446499 additions and 26 deletions

29
public/mxtk/gl.h Normal file
View File

@@ -0,0 +1,29 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: gl.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MTKGL
#define INCLUDED_MTKGL
#ifdef WIN32
#include "windows.h"
#endif
#include "GL/gl.h"
#endif // INCLUDED_MTKGL

143
public/mxtk/mx.h Normal file
View File

@@ -0,0 +1,143 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mx.h
// implementation: all
// last modified: Apr 28 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MX
#define INCLUDED_MX
#include "tier0/platform.h"
#ifdef WIN32
#include <windows.h>
#endif
#ifndef INCLUDED_MXBUTTON
#include "mxtk/mxButton.h"
#endif
#ifndef INCLUDED_MXCHECKBOX
#include "mxtk/mxCheckBox.h"
#endif
#ifndef INCLUDED_MXCHOICE
#include "mxtk/mxChoice.h"
#endif
#ifndef INCLUDED_MXCHOOSECOLOR
#include "mxtk/mxChooseColor.h"
#endif
#ifndef INCLUDED_MXEVENT
#include "mxtk/mxEvent.h"
#endif
#ifndef INCLUDED_MXFILEDIALOG
#include "mxtk/mxFileDialog.h"
#endif
#ifndef INCLUDED_MXGLWINDOW
#include "mxtk/mxGlWindow.h"
#endif
#ifndef INCLUDED_MXGROUPBOX
#include "mxtk/mxGroupBox.h"
#endif
#ifndef INCLUDED_MXINIT
#include "mxtk/mxInit.h"
#endif
#ifndef INCLUDED_MXLABEL
#include "mxtk/mxLabel.h"
#endif
#ifndef INCLUDED_MXLINEEDIT
#include "mxtk/mxLineEdit.h"
#endif
#ifndef INCLUDED_MXLINKEDLIST
#include "mxtk/mxLinkedList.h"
#endif
#ifndef INCLUDED_MXLISTBOX
#include "mxtk/mxListBox.h"
#endif
#ifndef INCLUDED_MXMENU
#include "mxtk/mxMenu.h"
#endif
#ifndef INCLUDED_MXMENUBAR
#include "mxtk/mxMenuBar.h"
#endif
#ifndef INCLUDED_MXMESSAGEBOX
#include "mxtk/mxMessageBox.h"
#endif
#ifndef INCLUDED_MXPOPUPMENU
#include "mxtk/mxPopupMenu.h"
#endif
#ifndef INCLUDED_MXPROGRESSBAR
#include "mxtk/mxProgressBar.h"
#endif
#ifndef INCLUDED_MXRADIOBUTTON
#include "mxtk/mxRadioButton.h"
#endif
#ifndef INCLUDED_MXSLIDER
#include "mxtk/mxSlider.h"
#endif
#ifndef INCLUDED_MXSCROLLBAR
#include "mxtk/mxScrollbar.h"
#endif
#ifndef INCLUDED_MXTAB
#include "mxtk/mxTab.h"
#endif
#ifndef INCLUDED_MXTOGGLEBUTTON
#include "mxtk/mxToggleButton.h"
#endif
#ifndef INCLUDED_MXTOOLTIP
#include "mxtk/mxToolTip.h"
#endif
#ifndef INCLUDED_MXTREEVIEW
#include "mxtk/mxTreeView.h"
#endif
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
#ifndef INCLUDED_MXWINDOW
#include "mxtk/mxWindow.h"
#endif
#ifndef INCLUDED_MXPATH
#include "mxtk/mxpath.h"
#endif
#ifndef INCLUDED_MXSTRING
#include "mxtk/mxstring.h"
#endif
#endif // INCLUDED_MX

79
public/mxtk/mxbmp.h Normal file
View File

@@ -0,0 +1,79 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxBmp.h
// implementation: all
// last modified: Apr 15 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXBMP
#define INCLUDED_MXBMP
#ifndef INCLUDED_MXIMAGE
#include "mxtk/mxImage.h"
#endif
#ifdef WIN32
#include <pshpack2.h>
#endif
typedef struct
{
word bfType;
int bfSize;
word bfReserved1;
word bfReserved2;
int bfOffBits;
} mxBitmapFileHeader;
typedef struct tagMxBitmapFileHeader
{
int biSize;
int biWidth;
int biHeight;
word biPlanes;
word biBitCount;
int biCompression;
int biSizeImage;
int biXPelsPerMeter;
int biYPelsPerMeter;
int biClrUsed;
int biClrImportant;
} mxBitmapInfoHeader;
typedef struct
{
byte rgbBlue;
byte rgbGreen;
byte rgbRed;
byte rgbReserved;
} mxBitmapRGBQuad;
#ifdef WIN32
#include <poppack.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
mxImage *mxBmpRead (const char *filename);
bool mxBmpWrite (const char *filename, mxImage *image);
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_MXBMP

50
public/mxtk/mxbutton.h Normal file
View File

@@ -0,0 +1,50 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxButton.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXBUTTON
#define INCLUDED_MXBUTTON
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxButton_i;
class mxButton : public mxWidget
{
mxButton_i *d_this;
public:
// CREATORS
mxButton (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int id = 0);
virtual ~mxButton ();
private:
// NOT IMPLEMENTED
mxButton (const mxButton&);
mxButton& operator= (const mxButton&);
};
#endif // INCLUDED_MXBUTTON

53
public/mxtk/mxcheckbox.h Normal file
View File

@@ -0,0 +1,53 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxCheckBox.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXCHECKBOX
#define INCLUDED_MXCHECKBOX
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxCheckBox_i;
class mxCheckBox : public mxWidget
{
mxCheckBox_i *d_this;
public:
// CREATORS
mxCheckBox (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int id = 0);
virtual ~mxCheckBox ();
// MANIPULATORS
void setChecked (bool b);
// ACCESSORS
bool isChecked () const;
private:
// NOT IMPLEMENTED
mxCheckBox (const mxCheckBox&);
mxCheckBox& operator= (const mxCheckBox&);
};
#endif // INCLUDED_MXCHECKBOX

59
public/mxtk/mxchoice.h Normal file
View File

@@ -0,0 +1,59 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxChoice.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXCHOICE
#define INCLUDED_MXCHOICE
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxChoice_i;
class mxChoice : public mxWidget
{
mxChoice_i *d_this;
public:
// CREATORS
mxChoice (mxWindow *parent, int x, int y, int w, int h, int id = 0);
virtual ~mxChoice ();
// MANIPULATORS
void add (const char *item);
void select (int index);
void remove (int index);
void removeAll ();
// ACCESSORS
int getItemCount () const;
int getSelectedIndex () const;
const char *getItemText (int index) const;
private:
// NOT IMPLEMENTED
mxChoice (const mxChoice&);
mxChoice& operator= (const mxChoice&);
};
#endif // INCLUDED_MXCHOICE

View File

@@ -0,0 +1,34 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxChooseColor.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXCHOOSECOLOR
#define INCLUDED_MXCHOOSECOLOR
class mxWindow;
#ifdef __cplusplus
extern "C" {
#endif
bool mxChooseColor (mxWindow *parent, int *r, int *g, int *b);
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_MXCHOOSECOLOR

81
public/mxtk/mxevent.h Normal file
View File

@@ -0,0 +1,81 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxEvent.h
// implementation: all
// last modified: Apr 12 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXEVENT
#define INCLUDED_MXEVENT
class mxWidget;
class mxEvent
{
public:
// ENUMS
enum {
Action,
Size,
Timer,
Idle,
Show,
Hide,
MouseUp,
MouseDown,
MouseMove,
MouseDrag,
KeyUp,
KeyDown,
MouseWheeled,
Focus,
Activate,
NCMouseUp,
NCMouseDown,
NCMouseMove,
NCMouseDrag,
Close,
PosChanged,
Char,
ParentNotify,
DropFile
};
enum { MouseLeftButton = 1, MouseRightButton = 2, MouseMiddleButton = 4};
enum { KeyCtrl = 1, KeyShift = 2 };
enum { RightClicked = 1, DoubleClicked = 2 };
// DATA
int event;
mxWidget *widget;
int action;
int width, height;
int x, y, buttons;
int key;
int modifiers;
int flags;
char szChars[MAX_PATH];
// NO CREATORS
mxEvent () : event (0), widget (0), action (0), width (0), height (0), x (0), y (0), buttons (0), key (0), modifiers (0), flags (0) {}
virtual ~mxEvent () {}
private:
// NOT IMPLEMENTED
mxEvent (const mxEvent&);
mxEvent& operator= (const mxEvent&);
};
#endif // INCLUDED_MXEVENT

View File

@@ -0,0 +1,36 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxFileDialog.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXFILEDIALOG
#define INCLUDED_MXFILEDIALOG
class mxWindow;
#ifdef __cplusplus
extern "C" {
#endif
const char *mxGetOpenFileName (mxWindow *parent, const char *path, const char *filter);
const char *mxGetSaveFileName (mxWindow *parent, const char *path, const char *filter);
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_MXFILEDIALOG

61
public/mxtk/mxglwindow.h Normal file
View File

@@ -0,0 +1,61 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxGlWindow.h
// implementation: all
// last modified: Apr 21 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXGLWINDOW
#define INCLUDED_MXGLWINDOW
#ifndef INCLUDED_MXWINDOW
#include "mxtk/mxWindow.h"
#endif
class mxGlWindow_i;
class mxGlWindow : public mxWindow
{
mxGlWindow_i *d_this;
void (*d_drawFunc) (void);
public:
// ENUMS
enum { FormatDouble, FormatSingle };
// CREATORS
mxGlWindow (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int style = 0);
virtual ~mxGlWindow ();
// MANIPULATORS
virtual int handleEvent (mxEvent *event);
virtual void redraw ();
virtual void draw ();
int makeCurrent ();
int swapBuffers ();
// MANIPULATORS
void setDrawFunc (void (*func) (void));
// STATIC MANIPULATORS
static void setFormat (int mode, int colorBits, int depthBits);
private:
// NOT IMPLEMENTED
mxGlWindow (const mxGlWindow&);
mxGlWindow& operator= (const mxGlWindow&);
};
#endif // INCLUDED_MXGLWINDOW

47
public/mxtk/mxgroupbox.h Normal file
View File

@@ -0,0 +1,47 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxGroupBox.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXGROUPBOX
#define INCLUDED_MXGROUPBOX
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxGroupBox_i;
class mxGroupBox : public mxWidget
{
mxGroupBox_i *d_this;
public:
// CREATORS
mxGroupBox (mxWindow *parent, int x, int y, int w, int h, const char *label = 0);
virtual ~mxGroupBox ();
private:
// NOT IMPLEMENTED
mxGroupBox (const mxGroupBox&);
mxGroupBox& operator= (const mxGroupBox&);
};
#endif // INCLUDED_MXGROUPBOX

106
public/mxtk/mximage.h Normal file
View File

@@ -0,0 +1,106 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxImage.h
// implementation: all
// last modified: Apr 15 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXIMAGE
#define INCLUDED_MXIMAGE
#ifndef byte
typedef unsigned char byte;
#endif // byte
#ifndef word
typedef unsigned short word;
#endif // word
class mxImage
{
public:
int width;
int height;
int bpp;
void *data;
void *palette;
// CREATORS
mxImage () : width (0), height (0), bpp (0), data (0), palette (0)
{
}
mxImage (int w, int h, int bpp)
{
create (w, h, bpp);
}
virtual ~mxImage ()
{
destroy ();
}
// MANIPULATORS
bool create (int w, int h, int pixelSize)
{
if (data)
delete[] data;
if (palette)
delete[] palette;
data = new byte[w * h * pixelSize / 8];
if (!data)
return false;
// allocate a palette for 8-bit images
if (pixelSize == 8)
{
palette = new byte[768];
if (!palette)
{
delete[] data;
return false;
}
}
else
palette = 0;
width = w;
height = h;
bpp = pixelSize;
return true;
}
void destroy ()
{
if (data)
delete[] data;
if (palette)
delete[] palette;
data = palette = 0;
width = height = bpp = 0;
}
private:
// NOT IMPLEMENTED
mxImage (const mxImage&);
mxImage& operator= (const mxImage&);
};
#endif // INCLUDED_MXIMAGE

84
public/mxtk/mxinit.h Normal file
View File

@@ -0,0 +1,84 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxInit.h
// implementation: all
// last modified: Apr 28 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXINIT
#define INCLUDED_MXINIT
#ifdef WIN32
#include <windows.h>
#endif
class mxWindow;
class mx
{
public:
// NO CREATORS
mx() {}
virtual ~mx () {}
// MANIPULATORS
static int init (int argc, char *argv[]);
static int run ();
static int check ();
static void quit ();
static int setDisplayMode (int w, int h, int bpp);
static void setIdleWindow (mxWindow *window);
// ACCESSORS
static int getDisplayWidth ();
static int getDisplayHeight ();
static mxWindow *getMainWindow ();
static const char *getApplicationPath ();
static int getTickCount ();
enum
{
ACCEL_ALT = (1<<0), // The ALT key must be held down when the accelerator key is pressed.
ACCEL_CONTROL = (1<<1), // The CTRL key must be held down when the accelerator key is pressed.
ACCEL_SHIFT = (1<<2), // The SHIFT key must be held down when the accelerator key is pressed.
ACCEL_VIRTKEY = (1<<3), // The key member specifies a virtual-key code. If this flag is not specified, key is assumed to specify a character code.
};
// Based on windows.h ACCEL structure!!!
struct Accel_t
{
Accel_t() :
flags( 0 ),
key( 0 ),
command( 0 )
{
}
unsigned char flags; // one or more of above ACCEL_ flags
unsigned short key; // Specifies the accelerator key. This member can be either a virtual-key code or a character code.
unsigned short command; // Specifies the accelerator identifier. This value is placed in the low-order word of the wParam parameter of the WM_COMMAND or WM_SYSCOMMAND message when the accelerator is pressed.
};
static void createAccleratorTable( int numentries, Accel_t *entries );
private:
// NOT IMPLEMENTED
mx (const mx&);
mx& operator= (const mx&);
};
#endif // INCLUDED_MXINIT

47
public/mxtk/mxlabel.h Normal file
View File

@@ -0,0 +1,47 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxLabel.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXLABEL
#define INCLUDED_MXLABEL
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxLabel_i;
class mxLabel : public mxWidget
{
mxLabel_i *d_this;
public:
// CREATORS
mxLabel (mxWindow *parent, int x, int y, int w, int h, const char *label = 0);
virtual ~mxLabel ();
private:
// NOT IMPLEMENTED
mxLabel (const mxLabel&);
mxLabel& operator= (const mxLabel&);
};
#endif // INCLUDED_MXLABEL

60
public/mxtk/mxlineedit.h Normal file
View File

@@ -0,0 +1,60 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxLineEdit.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXLINEEDIT
#define INCLUDED_MXLINEEDIT
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxLineEdit_i;
class mxLineEdit : public mxWidget
{
mxLineEdit_i *d_this;
public:
// ENUMS
enum { Normal, ReadOnly, Password };
// CREATORS
mxLineEdit (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int id = 0, int style = 0);
virtual ~mxLineEdit ();
// MANIPULATORS
void setMaxLength (int max);
// ACCESSORS
int getMaxLength () const;
void clear();
void getText( char *buf, size_t bufsize );
void setText( const char *pText );
private:
// NOT IMPLEMENTED
mxLineEdit (const mxLineEdit&);
mxLineEdit& operator= (const mxLineEdit&);
};
#endif // INCLUDED_MXLINEEDIT

191
public/mxtk/mxlinkedlist.h Normal file
View File

@@ -0,0 +1,191 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxLinkedList.h
// implementation: all
// last modified: Mar 19 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXLINKEDLIST
#define INCLUDED_MXLINKEDLIST
typedef struct mxListNode_s
{
void *d_data;
struct mxListNode_s *d_next;
struct mxListNode_s *d_prev;
} mxListNode;
class mxLinkedList
{
mxListNode *d_head;
mxListNode *d_tail;
int d_nodeCount;
// NOT IMPLEMENTED
mxLinkedList (const mxLinkedList&);
mxLinkedList& operator= (const mxLinkedList&);
public:
//CREATORS
mxLinkedList ()
{
d_head = new mxListNode;
d_tail = new mxListNode;
d_head->d_data = 0;
d_head->d_next = d_tail;
d_head->d_prev = 0;
d_tail->d_data = 0;
d_tail->d_next = 0;
d_tail->d_prev = d_head;
d_nodeCount = 0;
}
~mxLinkedList ()
{
removeAll ();
delete d_tail;
delete d_head;
}
// MANIPULATORS
void add (void *data)
{
mxListNode *node = new mxListNode;
node->d_data = data;
d_tail->d_prev->d_next = node;
node->d_prev = d_tail->d_prev;
node->d_next = d_tail;
d_tail->d_prev = node;
++d_nodeCount;
}
void remove (void *data)
{
mxListNode *node = d_head->d_next;
while (node != d_tail)
{
mxListNode *next = node->d_next;
if (node->d_data == data)
{
node->d_prev->d_next = node->d_next;
node->d_next->d_prev = node->d_prev;
delete node;
}
node = next;
}
--d_nodeCount;
}
void removeAll ()
{
mxListNode *node = d_head->d_next;
while (node != d_tail)
{
mxListNode *next = node->d_next;
delete node;
node = next;
}
d_head->d_next = d_tail;
d_tail->d_prev = d_head;
d_nodeCount = 0;
}
void setData (mxListNode *node, void *data)
{
if (node)
node->d_data = data;
}
// ACCESSORS
void *getData (mxListNode *node) const
{
if (node)
return node->d_data;
return 0;
}
mxListNode *getFirst () const
{
if (d_head->d_next != d_tail)
return d_head->d_next;
return 0;
}
mxListNode *getNext (mxListNode *node) const
{
if (node)
{
if (node->d_next != d_tail)
return node->d_next;
return 0;
}
return 0;
}
mxListNode *getLast () const
{
if (d_tail->d_prev != d_head)
return d_tail->d_prev;
return 0;
}
mxListNode *getPrev (mxListNode *node) const
{
if (node)
{
if (node->d_prev != d_head)
return node->d_prev;
return 0;
}
return 0;
}
mxListNode *at (int pos) const
{
mxListNode *node = d_head->d_next;
while (pos > 0 && node != d_tail)
{
pos--;
node = node->d_next;
}
if (node != d_tail)
return node;
return 0;
}
bool isEmpty () const
{
return (d_head->d_next == d_tail);
}
int getNodeCount () const
{
return d_nodeCount;
}
};
#endif // INCLUDED_MXLINKEDLIST

67
public/mxtk/mxlistbox.h Normal file
View File

@@ -0,0 +1,67 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxListBox.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXLIST
#define INCLUDED_MXLIST
#ifndef INCLUDED_MxWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxListBox_i;
class mxListBox : public mxWidget
{
mxListBox_i *d_this;
public:
// ENUMS
enum { Normal, MultiSelection };
// CREATORS
mxListBox (mxWindow *parent, int x, int y, int w, int h, int id = 0, int style = 0);
virtual ~mxListBox ();
// MANIPULATORS
void add (const char *item);
void select (int index);
void deselect (int index);
void remove (int index);
void removeAll ();
void setItemText (int index, const char *text);
void setItemData (int index, void *data);
// ACCESSORS
int getItemCount () const;
int getSelectedIndex () const;
bool isSelected (int index) const;
const char *getItemText (int index) const;
void *getItemData (int index) const;
int getTopIndex () const;
private:
// NOT IMPLEMENTED
mxListBox (const mxListBox&);
mxListBox& operator= (const mxListBox&);
};
#endif // INCLUDED_MXLISTBOX

66
public/mxtk/mxlistview.h Normal file
View File

@@ -0,0 +1,66 @@
//========= Copyright © 1996-2003, Valve LLC, All rights reserved. ============
//
// Purpose:
//
//=============================================================================
#ifndef MXLISTVIEW_H
#define MXLISTVIEW_H
#ifdef _WIN32
#pragma once
#endif
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
#include <wchar.h>
class mxWindow;
class mxListView_i;
class mxListView : public mxWidget
{
mxListView_i *d_this;
public:
// CREATORS
mxListView (mxWindow *parent, int x, int y, int w, int h, int id = 0);
virtual ~mxListView ();
// MANIPULATORS
int add( const char *label );
void remove ( int item );
void removeAll ();
void setLabel ( int item, int column, const char *label);
void setLabel( int item, int column, const wchar_t *label );
void setUserData (int item, int column, void *userData);
void setSelected ( int item, bool b);
void deselectAll();
void setImageList( void *himagelist );
void setImage( int item, int column, int imagenormal );
void insertTextColumn( int column, int width, char const *label );
void insertImageColumn( int column, int width, int imageindex );
void scrollToItem( int item );
// ACCESSORS
int getItemCount() const;
int getNumSelected() const;
int getNextSelectedItem ( int startitem = 0 ) const;
const char *getLabel ( int oitem, int column ) const;
void *getUserData (int item, int column ) const;
bool isSelected ( int index ) const;
void setDrawingEnabled( bool draw );
private:
// NOT IMPLEMENTED
mxListView (const mxListView&);
mxListView& operator= (const mxListView&);
};
#endif // MXLISTVIEW_H

View File

@@ -0,0 +1,60 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxMatSysWindow.h
// implementation: all
// last modified: Apr 21 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXMATSYSWINDOW
#define INCLUDED_MXMATSYSWINDOW
#ifndef INCLUDED_MXWINDOW
#include "mxtk/mxWindow.h"
#endif
class mxMatSysWindow_i;
class mxMatSysWindow : public mxWindow
{
mxMatSysWindow_i *d_this;
void (*d_drawFunc) (void);
public:
// ENUMS
enum { FormatDouble, FormatSingle };
// CREATORS
mxMatSysWindow (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int style = 0);
virtual ~mxMatSysWindow ();
// IMaterialSystem *Init( const char *szGamedir, const char *szMaterialSystem, const char *szShader, const char *szProxy );
// MANIPULATORS
virtual int handleEvent (mxEvent *event);
virtual void redraw ();
virtual void draw ();
int makeCurrent ();
int swapBuffers ();
// MANIPULATORS
void setDrawFunc (void (*func) (void));
private:
// NOT IMPLEMENTED
mxMatSysWindow (const mxMatSysWindow&);
mxMatSysWindow& operator= (const mxMatSysWindow&);
};
#endif // INCLUDED_MXGLWINDOW

54
public/mxtk/mxmenu.h Normal file
View File

@@ -0,0 +1,54 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxMenu.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXMENU
#define INCLUDED_MXMENU
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxMenu_i;
class mxMenu : public mxWidget
{
mxMenu_i *d_this;
public:
// CREATORS
mxMenu ();
virtual ~mxMenu ();
// MANIPULATORS
void add (const char *item, int id);
void addMenu (const char *item, mxMenu *menu);
void addSeparator ();
void setEnabled (int id, bool b);
void setChecked (int id, bool b);
// ACCESSORS
bool isEnabled (int id) const;
bool isChecked (int id) const;
private:
// NOT IMPLEMENTED
mxMenu (const mxMenu&);
mxMenu& operator= (const mxMenu&);
};
#endif // INCLUDED_MXMENU

59
public/mxtk/mxmenubar.h Normal file
View File

@@ -0,0 +1,59 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxMenuBar.h
// implementation: all
// last modified: Apr 28 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXMENUBAR
#define INCLUDED_MXMENUBAR
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxMenu;
class mxMenuBar_i;
class mxMenuBar : public mxWidget
{
mxMenuBar_i *d_this;
public:
// CREATORS
mxMenuBar (mxWindow *parent);
virtual ~mxMenuBar ();
// MANIPULATORS
void addMenu (const char *item, mxMenu *menu);
void setEnabled (int id, bool b);
void setChecked (int id, bool b);
void modify (int id, int newId, const char *newItem);
// ACCESSORS
bool isEnabled (int id) const;
bool isChecked (int id) const;
int getHeight () const;
private:
// NOT IMPLEMENTED
mxMenuBar (const mxMenuBar&);
mxMenuBar& operator= (const mxMenuBar&);
};
#endif // INCLUDED_MXMENUBAR

View File

@@ -0,0 +1,47 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxMessageBox.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXMESSAGEBOX
#define INCLUDED_MXMESSAGEBOX
class mxWindow;
enum {
MX_MB_OK = 0,
MX_MB_YESNO = 1,
MX_MB_YESNOCANCEL = 2,
MX_MB_INFORMATION = 4,
MX_MB_ERROR = 8,
MX_MB_WARNING = 16,
MX_MB_QUESTION = 32
};
#ifdef __cplusplus
extern "C" {
#endif
int mxMessageBox (mxWindow *parent, const char *msg, const char *title, int style = 0);
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_MXMESSAGEBOX

37
public/mxtk/mxpath.h Normal file
View File

@@ -0,0 +1,37 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxpath.h
// implementation: all
// last modified: Apr 28 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXPATH
#define INCLUDED_MXPATH
#ifdef __cplusplus
extern "C" {
#endif
bool mx_setcwd (const char *path);
const char *mx_getcwd ();
const char *mx_getpath (const char *filename);
const char *mx_getextension (const char *filename);
const char *mx_gettemppath ();
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_MXPATH

62
public/mxtk/mxpcx.h Normal file
View File

@@ -0,0 +1,62 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxPcx.h
// implementation: all
// last modified: Apr 15 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXPCX
#define INCLUDED_MXPCX
#ifndef INCLUDED_MXIMAGE
#include "mxtk/mxImage.h"
#endif
typedef struct
{
byte manufacturer; /* 10 = ZSoft .pcx */
byte version; /* 0 = Version 2.5 of PC Paintbrush
2 = Version 2.8 w/palette information
3 = Version 2.8 w/o palette information
4 = PC Paintbrush for Windows(Plus for
Windows uses Ver 5)
5 = Version 3.0 and > of PC Paintbrush
and PC Paintbrush +, includes
Publisher's Paintbrush . Includes
24-bit .PCX files */
byte encoding; /* 1 = .pcx rle encoding */
byte bitsPerPixel; /* 1, 2, 4, 8 per plane */
word xmin;
word ymin;
word xmax;
word ymax;
word hDpi;
word vDpi;
byte colorMap[48];
byte reserved; /* should be set to 0 */
byte numPlanes; /* number of color planes */
word bytesPerLine; /* MUST be EVEN number */
word paletteInfo; /* 1 = color, 2 = grayscale */
word hScreenSize;
word vScreenSize;
byte filler[54]; /* set all to 0 */
} mxPcxHeader;
mxImage *mxPcxRead (const char *filename);
bool mxPcxWrite (const char *filename, mxImage *image);
#endif // INCLUDED_MXPCX

55
public/mxtk/mxpopupmenu.h Normal file
View File

@@ -0,0 +1,55 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxPopupMenu.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXPOPUPMENU
#define INCLUDED_MXPOPUPMENU
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxPopupMenu_i;
class mxPopupMenu : public mxWidget
{
mxPopupMenu_i *d_this;
public:
// CREATORS
mxPopupMenu ();
virtual ~mxPopupMenu ();
// MANIPULATORS
int popup (mxWidget *widget, int x, int y);
void add (const char *item, int id);
void addMenu (const char *item, mxPopupMenu *menu);
void addSeparator ();
void setEnabled (int id, bool b);
void setChecked (int id, bool b);
// ACCESSORS
bool isEnabled (int id) const;
bool isChecked (int id) const;
private:
// NOT IMPLEMENTED
mxPopupMenu (const mxPopupMenu&);
mxPopupMenu& operator= (const mxPopupMenu&);
};
#endif // INCLUDED_MXPOPUPMENU

View File

@@ -0,0 +1,58 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxProgressBar.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXPROGRESSBAR
#define INCLUDED_MXPROGRESSBAR
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxProgressBar_i;
class mxProgressBar : public mxWidget
{
mxProgressBar_i *d_this;
public:
// ENUMS
enum { Normal, Smooth };
// CREATORS
mxProgressBar (mxWindow *parent, int x, int y, int w, int h, int style = 0);
virtual ~mxProgressBar ();
// MANIPULATORS
void setValue (int value);
void setTotalSteps (int steps);
// ACCESSORS
int getValue () const;
int getTotalSteps () const;
private:
// NOT IMPLEMENTED
mxProgressBar (const mxProgressBar&);
mxProgressBar& operator= (const mxProgressBar&);
};
#endif // INCLUDED_MXPROGRESSBAR

View File

@@ -0,0 +1,53 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxRadioButton.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXRADIOBUTTON
#define INCLUDED_MXRADIOBUTTON
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxRadioButton_i;
class mxRadioButton : public mxWidget
{
mxRadioButton_i *d_this;
public:
// CREATORS
mxRadioButton (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int id = 0, bool newGroup = 0);
virtual ~mxRadioButton ();
// MANIPULATORS
void setChecked (bool b);
// ACCESSORS
bool isChecked () const;
private:
// NOT IMPLEMENTED
mxRadioButton (const mxRadioButton&);
mxRadioButton& operator= (const mxRadioButton&);
};
#endif // INCLUDED_MXRADIOBUTTON

61
public/mxtk/mxscrollbar.h Normal file
View File

@@ -0,0 +1,61 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxScrollbar.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXSCROLLBAR
#define INCLUDED_MXSCROLLBAR
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxScrollbar_i;
class mxScrollbar : public mxWidget
{
mxScrollbar_i *d_this;
public:
// ENUMS
enum { Horizontal, Vertical };
// CREATORS
mxScrollbar (mxWindow *parent, int x, int y, int w, int h, int id = 0, int style = 0);
virtual ~mxScrollbar ();
// MANIPULATORS
void setValue (int ivalue);
void setRange (int min, int max);
void setPagesize (int size);
// ACCESSORS
int getValue () const;
int getMinValue () const;
int getMaxValue () const;
int getPagesize () const;
private:
// NOT IMPLEMENTED
mxScrollbar (const mxScrollbar&);
mxScrollbar& operator= (const mxScrollbar&);
};
#endif // INCLUDED_MXSCROLLBAR

67
public/mxtk/mxslider.h Normal file
View File

@@ -0,0 +1,67 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxSlider.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXSLIDER
#define INCLUDED_MXSLIDER
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxSlider_i;
class mxSlider : public mxWidget
{
mxSlider_i *d_this;
float m_min;
float m_max;
int m_ticks;
public:
// ENUMS
enum { Horizontal, Vertical };
// CREATORS
mxSlider (mxWindow *parent, int x, int y, int w, int h, int id = 0, int style = 0);
virtual ~mxSlider ();
// MANIPULATORS
void setValue (float value);
void setRange (float min, float max, int ticks = 100);
void setSteps (int line, int page);
// ACCESSORS
float getValue () const;
float getTrackValue ( int ivalue ) const;
float getMinValue () const;
float getMaxValue () const;
int getLineStep () const;
int getPageStep () const;
private:
// NOT IMPLEMENTED
mxSlider (const mxSlider&);
mxSlider& operator= (const mxSlider&);
};
#endif // INCLUDED_MXSLIDER

34
public/mxtk/mxstring.h Normal file
View File

@@ -0,0 +1,34 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxstring.h
// implementation: all
// last modified: Apr 28 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXSTRING
#define INCLUDED_MXSTRING
#ifdef __cplusplus
extern "C" {
#endif
int mx_strncasecmp (const char *s1, const char *s2, int count);
int mx_strcasecmp (const char *s1, const char *s2);
char *mx_strlower (char *str);
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_MXPATH

55
public/mxtk/mxtab.h Normal file
View File

@@ -0,0 +1,55 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxTab.h
// implementation: all
// last modified: Apr 18 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXTAB
#define INCLUDED_MXTAB
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxTab_i;
class mxTab : public mxWidget
{
mxTab_i *d_this;
public:
// CREATORS
mxTab (mxWindow *parent, int x, int y, int w, int h, int id = 0);
virtual ~mxTab ();
// MANIPULATORS
void add (mxWidget *widget, const char *text);
void remove (int index);
void select (int index);
// ACCESSORS
int getSelectedIndex () const;
private:
// NOT IMPLEMENTED
mxTab (const mxTab&);
mxTab& operator= (const mxTab&);
};
#endif // INCLUDED_MXTAB

30
public/mxtk/mxtga.h Normal file
View File

@@ -0,0 +1,30 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxTga.h
// implementation: all
// last modified: Apr 15 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXTGA
#define INCLUDED_MXTGA
#ifndef INCLUDED_MXIMAGE
#include "mxtk/mxImage.h"
#endif
mxImage *mxTgaRead (const char *filename);
bool mxTgaWrite (const char *filename, mxImage *image);
#endif // INCLUDED_MXTGA

View File

@@ -0,0 +1,53 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxToggleButton.h
// implementation: all
// last modified: Apr 28 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXTOGGLEBUTTON
#define INCLUDED_MXTOGGLEBUTTON
#ifndef INCLUDED_MXWIDEGT
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
class mxToggleButton_i;
class mxToggleButton : public mxWidget
{
mxToggleButton_i *d_this;
public:
// CREATORS
mxToggleButton (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int id = 0);
virtual ~mxToggleButton ();
// MANIPULATORS
void setChecked (bool b);
// ACCESSORS
bool isChecked () const;
private:
// NOT IMPLEMENTED
mxToggleButton (const mxToggleButton&);
mxToggleButton& operator= (const mxToggleButton&);
};
#endif // INCLUDED_MXTOGGLEBUTTON

41
public/mxtk/mxtooltip.h Normal file
View File

@@ -0,0 +1,41 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxToolTip.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXTOOLTIP
#define INCLUDED_MXTOOLTIP
class mxWidget;
class mxToolTip
{
public:
// NO CREATORS
mxToolTip() {}
virtual ~mxToolTip () {}
// MANIPULATORS
static void add (mxWidget *widget, const char *text);
private:
// NOT IMPLEMENTED
mxToolTip (const mxToolTip&);
mxToolTip& operator= (const mxToolTip&);
};
#endif // INCLUDED_MXTOOLTIP

77
public/mxtk/mxtreeview.h Normal file
View File

@@ -0,0 +1,77 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxTreeView.h
// implementation: all
// last modified: Apr 12 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXTREEVIEW
#define INCLUDED_MXTREEVIEW
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
class mxWindow;
typedef void *mxTreeViewItem;
//typedef int __stdcall (*TreeSortFunc)(long lParam1, long lParam2, long lParamSort);
class mxTreeView_i;
class mxTreeView : public mxWidget
{
mxTreeView_i *d_this;
public:
// CREATORS
mxTreeView (mxWindow *parent, int x, int y, int w, int h, int id = 0);
virtual ~mxTreeView ();
// MANIPULATORS
mxTreeViewItem *add (mxTreeViewItem *parent, const char *item);
void remove (mxTreeViewItem *item);
void removeAll ();
void setLabel (mxTreeViewItem *item, const char *label);
void setUserData (mxTreeViewItem *item, void *userData);
void setOpen (mxTreeViewItem *item, bool b);
void setSelected (mxTreeViewItem *item, bool b);
void setImageList( void *himagelist );
void setImages(mxTreeViewItem *item, int imagenormal, int imageselected );
void moveItemDown( mxTreeViewItem *item );
void sortTree( mxTreeViewItem *parent, bool recurse,
void *func, int parameter );
void scrollTo( mxTreeViewItem *item );
// ACCESSORS
mxTreeViewItem *getFirstChild (mxTreeViewItem *item) const;
mxTreeViewItem *getNextChild (mxTreeViewItem *item) const;
mxTreeViewItem *getSelectedItem () const;
const char *getLabel (mxTreeViewItem *item) const;
void *getUserData (mxTreeViewItem *item) const;
bool isOpen (mxTreeViewItem *item) const;
bool isSelected (mxTreeViewItem *item) const;
mxTreeViewItem *getParent (mxTreeViewItem *item) const;
private:
// NOT IMPLEMENTED
mxTreeView (const mxTreeView&);
mxTreeView& operator= (const mxTreeView&);
};
#endif // INCLUDED_MXTREEVIEW

112
public/mxtk/mxwidget.h Normal file
View File

@@ -0,0 +1,112 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxWidget.h
// implementation: all
// last modified: Apr 28 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXWIDGET
#define INCLUDED_MXWIDGET
#include "tier0/platform.h"
enum
{
MX_BUTTON,
MX_CHECKBOX,
MX_CHOICE,
MX_GLWINDOW,
MX_MATSYSWINDOW,
MX_GROUPBOX,
MX_LABEL,
MX_LINEEDIT,
MX_LISTBOX,
MX_MENU,
MX_MENUBAR,
MX_POPUPMENU,
MX_PROGRESSBAR,
MX_RADIOBUTTON,
MX_SLIDER,
MX_SCROLLBAR,
MX_TAB,
MX_TOGGLEBUTTON,
MX_TREEVIEW,
MX_WINDOW,
MX_LISTVIEW,
};
class mxWindow;
class mxWidget_i;
class mxWidget
{
mxWidget_i *d_this;
protected:
void setHandle (void *handle);
void setType (int type);
void setParent (mxWindow *parentWindow);
public:
// CREATORS
mxWidget (mxWindow *parent, int x, int y, int w, int h, const char *label = 0);
virtual ~mxWidget ();
// Called just before deletion during shutdown
// Closing of application aborted if any control returns false
virtual bool CanClose();
virtual void OnDelete();
// MANIPULATORS
// void setBounds (int x, int y, int w, int h);
//
//
void setBounds (int x, int y, int w, int h);
// void setLabel (const char *label);
//
//
void setLabel (const char *format, ... );
void setVisible (bool b);
void setEnabled (bool b);
void setId (int id);
void setUserData (void *userData);
// ACCESSORS
void *getHandle () const;
int getType () const;
mxWindow *getParent () const;
int x () const;
int y () const;
int w () const;
int h () const;
int w2 () const;
int h2 () const;
const char *getLabel () const;
bool isVisible () const;
bool isEnabled () const;
int getId () const;
void *getUserData () const;
private:
// NOT IMPLEMENTED
mxWidget (const mxWidget&);
mxWidget& operator= (const mxWidget&);
};
#endif // INCLUDED_MXWIDGET

74
public/mxtk/mxwindow.h Normal file
View File

@@ -0,0 +1,74 @@
//
// mxToolKit (c) 1999 by Mete Ciragan
//
// file: mxWindow.h
// implementation: all
// last modified: Mar 14 1999, Mete Ciragan
// copyright: The programs and associated files contained in this
// distribution were developed by Mete Ciragan. The programs
// are not in the public domain, but they are freely
// distributable without licensing fees. These programs are
// provided without guarantee or warrantee expressed or
// implied.
//
#ifndef INCLUDED_MXWINDOW
#define INCLUDED_MXWINDOW
#ifndef INCLUDED_MXWIDGET
#include "mxtk/mxWidget.h"
#endif
#ifndef INCLUDED_MXEVENT
#include "mxtk/mxEvent.h"
#endif
class mxMenuBar;
class mxWindow_i;
class mxWindow : public mxWidget
{
mxWindow_i *d_this;
public:
// ENUMS
enum { Normal, Popup, Dialog, ModalDialog };
// CREATORS
mxWindow (mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int style = 0);
virtual ~mxWindow ();
// MANIPULATORS
virtual int handleEvent (mxEvent *event);
/*
virtual int handleActionEvent (int action);
virtual void handleSizeEvent (int w, int h);
virtual void handleMouseEvent (int event, int x, int y, int button);
virtual void handleKeyEvent (int event, int key);
virtual void handleTimerEvent ();
virtual void handleIdleEvent ();
*/
virtual void redraw ();
virtual bool PaintBackground( void ) { return true; };
// Called at exit
virtual bool Closing( void ) { return true; };
void setTimer (int milliSeconds);
void setMenuBar (mxMenuBar *menuBar);
private:
// NOT IMPLEMENTED
mxWindow (const mxWindow&);
mxWindow& operator= (const mxWindow&);
};
#endif // INCLUDED_MXWINDOW