00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _MGUIPP_H
00014 #define _MGUIPP_H
00015
00016 #include "mgui.h"
00017
00025 class CmMGUI {
00026 protected:
00037 virtual inline void beep(void);
00048 int getKeyboardState(void);
00059 const char *getSysDir(void);
00067 const char *getApplicationName(void);
00077 int paletteMode(void);
00083 int getScreenWidth(void);
00089 int getScreenHeight(void);
00098 int getNPlanes(void);
00107 long getNColors(void);
00116 MTColor getBlackColor(void);
00125 MTColor getWhiteColor(void);
00126
00142 void enableCustomizing(void);
00166 char *getStringOption(const char *obj_name, const char *opt_name);
00181 char *getTextOption(const char *obj_name);
00208 int getIntOption(const char *obj_name, const char *opt_name, int *ret);
00240 int getFontOption(const char *obj_name, MTFont *ret);
00264 int getBGColorOption(const char *obj_name, int *pr, int *pg, int *pb);
00288 int getFGColorOption(const char *obj_name, int *pr, int *pg, int *pb);
00313 int getShadowOption(const char *obj_name, int *shadow, int *i_t, int *o_t);
00336 void setStringOption(const char *obj_name, const char *opt_name, const char *text);
00354 void setTextOption(const char *obj_name, const char *text);
00376 void setIntOption(const char *obj_name, const char *opt_name, int val);
00403 void setFontOption(const char *obj_name, MTFont font);
00424 void setBGColorOption(const char *obj_name, int r, int g, int b);
00445 void setFGColorOption(const char *obj_name, int r, int g, int b);
00467 void setShadowOption(const char *obj_name, int shadow, int in_t, int out_t);
00485 void saveOptions(void);
00486
00515 void logInit(int level, int nr, int nvr, int nc, int nvc, const char *fname);
00530 void log(int level, const char *fmt, ...);
00552 void maskedLog(int level, CARD32 mask, const char *fmt, ...);
00563 void logSetLevel(int level);
00575 void logSetMask(CARD32 mask);
00583 CARD32 logGetMask(void);
00597 void logSetMaskBits(CARD32 mask);
00612 void logResetMaskBits(CARD32 mask);
00623 void setTraceFileName(const char *fname);
00625 void logSetTimeFormat(const char *strftime_format);
00627 void traceSetTimeFormat(const char *strftime_format);
00644 void trace(const char *fmt,...);
00663 void getDefaultBackgroundRGB(int *pr, int *pg, int *pb);
00682 void setDefaultBackgroundRGB(int r, int g, int b);
00701 void getDefaultForegroundRGB(int *pr, int *pg, int *pb);
00720 void setDefaultForegroundRGB(int r, int g, int b);
00732 int textCharX(const char *text, MTFont font, int i);
00740 int textHeight(const char *text, MTFont font);
00748 int charHeight(char ch, MTFont font);
00756 int textWidth(const char *text, MTFont font);
00764 int textNWidth(const char *text, MTFont font, int n);
00772 int charWidth(char ch, MTFont font);
00793 int spoolFile(const char *fname);
00815 int spoolTempFile(const char *fname);
00831 void mainLoop(void);
00849 void loopWhileFlag(int *pflag, int value);
00865 void loopWhileEvents(int discard);
00879 void nextEvent(MEvent *pe, int wait);
00889 void processEvent(MEvent *pe);
00913 int messageDialog(const char *title, const char *msg, const char *btn1,
00914 const char *btn2, ...);
00939 int inputPrompt(const char *title, const char *msg, char *text, int len,
00940 const char *ok_btn, const char *canc_btn);
00969 char *textPrompt(const char *title, const char *msg, const char *text,
00970 int w, int h, const char *ok_btn, const char *canc_btn);
00998 int fileSelection(const char *title, char *filter, char *fname,
00999 char *dname, int change_cur_dir);
01027 int fileBrowse(const char *title, char *filter, char *fname,
01028 char *dname, int change_cur_dir);
01029
01056 int fileBrowseExt(const char *title, const char *filter, char *fname, char *dname,
01057 FB_PREFS *prefs);
01058
01081 int dirBrowse(const char *title, const char *filter, char *dname,
01082 int change_cur_dir);
01083
01108 int dirBrowseExt(const char *title, const char *filter, char *dname,
01109 FB_PREFS *prefs);
01122 inline const char *getCurrentDirectory(void);
01137 void setInputPromptRGB(int r, int g, int b);
01139 inline void setInputPromptFgRGB(int r, int g, int b);
01141 inline void setInputPromptFonts(MTFont text_font, MTFont edit_font, MTFont buttons_font);
01156 void setMessageDialogRGB(int r, int g, int b);
01171 void setFileSelectionRGB(int r, int g, int b);
01173 inline void setMessageDialogFgRGB(int r, int g, int b);
01175 inline void setMessageDialogFonts(MTFont text_font, MTFont buttons_font);
01190 void getInputPromptRGB(int *pr, int *pg, int *pb);
01192 inline void getInputPromptFgRGB(int *pr, int *pg, int *pb);
01194 inline void getInputPromptFonts(MTFont *text_font, MTFont *edit_font, MTFont *buttons_font);
01209 void getMessageDialogRGB(int *pr, int *pg, int *pb);
01211 inline void getMessageDialogFgRGB(int *pr, int *pg, int *pb);
01213 inline void getMessageDialogFonts(MTFont *text_font, MTFont *buttons_font);
01228 void getFileSelectionRGB(int *pr, int *pg, int *pb);
01255 void setFileSelectionTextStrings(
01256 char *file_list, char *dir_list, char *drive_list, char *filter,
01257 char *filename, char *curr_dir, char *ok_button, char *close_button);
01258 };
01259
01260
01261 class CmMenuItem;
01262 class CmTreeNode;
01263 class CmTimeout;
01264 class CmSocketHandler;
01265
01275 typedef class CmMGUI CmCallback;
01276
01280
01282 typedef void (CmCallback::*VOID_CB)(void);
01284 typedef void (CmCallback::*EVENT_CB)(MEvent *);
01286 typedef void (CmCallback::*LONG_CB)(long);
01288 typedef void (CmCallback::*INT_CB)(int);
01290 typedef void (CmCallback::*MENUITEM_CB)(int);
01292 typedef void (CmCallback::*ITEMSEL_CB)(CmMenuItem *);
01294 typedef void (CmCallback::*STRING_CB)(char *);
01296 typedef void (CmCallback::*NEWBLOCK_CB)(SBL_NEW_BLOCK *);
01298 typedef void (CmCallback::*ITEMSEEK_CB)(SBL_ITEM_SEEK *);
01300 typedef void (CmCallback::*EDITVAL_CB)(EDIT_VAL *);
01302 typedef void (CmCallback::*EDITCURS_CB)(EDIT_CURS *);
01304 typedef void (CmCallback::*EDITCHANGE_CB)(EDIT_CHANGE *);
01306 typedef void (CmCallback::*LISTACT_CB)(LIST_ACT *);
01308 typedef void (CmCallback::*LISTSEL_CB)(LIST_SEL *);
01310 typedef void (CmCallback::*DRAWAREAPREF_CB)(DRAWAREA_PREF *);
01312 typedef void (CmCallback::*SOCKETPP_CB)(unsigned);
01314 typedef void (CmCallback::*SOCKETPP2_CB)(CmSocketHandler *, unsigned);
01316 typedef void (CmCallback::*TIMEOUTPP2_CB)(CmTimeout *);
01318 typedef void (CmCallback::*MTREENODE_CB)(CmTreeNode *);
01320 typedef void (CmCallback::*MTREEPOPUP_CB)(CmTreeNode *, int, int);
01322 typedef int (CmCallback::*MTREERENAME_CB)(CmTreeNode *, const char *);
01324 typedef int (CmCallback::*MTREEDELETE_CB)(CmTreeNode *);
01326 typedef void (CmCallback::*DBDIRCHANGE_CB)(const char *);
01328 typedef int (CmCallback::*DBACTION_CB)(const char *, char *);
01330
01341 class CmAppl : public CmMGUI {
01342 friend void MGUIMain(int argc, char **argv);
01343 static CmAppl *app_inst;
01344 protected:
01345 CmAppl(void);
01346 public:
01351 virtual void start(int argc, char **argv)=0;
01359 static void end(int code);
01360 };
01361
01377 class CmTimeout : public CmMGUI {
01378 friend void _TimeoutCB_(TIMEOUT_ID id, void *ud);
01379 TIMEOUT_ID tid;
01380 CARD32 msec;
01381 int continuous;
01382 int stopped;
01383 VOID_CB callback;
01384 CmCallback *owner;
01385
01386 public:
01387 virtual ~CmTimeout(void);
01401 CmTimeout(CmCallback *owner, VOID_CB cb, CARD32 msec, int continuous=False);
01407 void start(CARD32 msec);
01414 void start(void);
01418 void stop(void);
01419 };
01420
01425 class CmSocketHandler : public CmMGUI {
01426 friend void _SocketCB_(int s, unsigned events, void *ud);
01427 int sid;
01428 SOCKETPP_CB callback;
01429 SOCKETPP2_CB callback2;
01430 CmCallback *owner;
01431
01432 public:
01433 CmSocketHandler(int s, CmCallback *own, SOCKETPP_CB cb, unsigned events);
01434 CmSocketHandler(int s, CmCallback *own, SOCKETPP2_CB cb, unsigned events);
01435 virtual ~CmSocketHandler(void);
01436 void setEventsMask(unsigned events);
01437 unsigned getEventsMask(void);
01438 int getSocketId(void) { return sid; }
01439 };
01440
01441
01446 class CmColor {
01447 protected:
01448 MTColor id;
01449 public:
01451 CmColor(MTColor cc=0) { id = cc;}
01453 operator MTColor() { return id; }
01455 void getRGB(int *r, int *g, int *b);
01456 };
01457
01462 class CmSharedColor : public CmColor {
01463 public:
01464 virtual ~CmSharedColor(void);
01466 CmSharedColor(unsigned r, unsigned g, unsigned b);
01471 CmSharedColor(CmColor *c, int shift=100);
01472 };
01473
01478 class CmRWColor : public CmColor {
01479 public:
01480 virtual ~CmRWColor(void);
01482 CmRWColor(unsigned r, unsigned g, unsigned b);
01484 void setRGB(int r, int g, int b);
01485 };
01486
01504 class CmImage : public MIMAGE_DESCR {
01505 protected:
01506 void allocImage(int imgw, int imgh, int np);
01507 public:
01508 virtual ~CmImage(void);
01514 static inline void addDefaultTypeGIF(void);
01521 static inline void addDefaultTypeTIFF(void);
01528 static inline void addDefaultTypeJPEG(void);
01535 static inline void addDefaultTypePNG(void);
01560 static inline void addPath(const char *path);
01568 static inline void removePath(const char *path);
01585 CmImage(const char *fname);
01597 CmImage(int imgw, int imgh, int np);
01598
01603 void install(void);
01609 void uninstall(void);
01611 int getWidth(void) { return img_w; }
01613 int getHeight(void) { return img_h; }
01618 int getNColors(void) { return ncolors; }
01620 int getNPlanes(void) { return nplanes; }
01638 void getPixelRGB(int x, int y, int *pr, int *pg, int *pb);
01655 void setPixelRGB(int x, int y, int r, int g, int b);
01662 int getPixelIndex(int x, int y);
01668 void setPixelIndex(int x, int y, int i);
01684 void getCMapEntry(int i, int *pr, int *pg, int *pb);
01697 void setCMapEntry(int i, int r, int g, int b);
01705 void merge(CmImage *src, int xo, int yo, int transparent);
01712 void setMask(CmImage *mask);
01714 inline void setMaskByCMapIndex(int id);
01716 inline void setMaskByPixel(int x, int y);
01718 inline void setMaskByRGB(int r, int g, int b);
01720 inline void addAlphaChannel(void);
01722 inline int getPixelAlpha(int x, int y);
01724 inline void setPixelAlpha(int x, int y, CARD8 alpha);
01726 CmImage *clone(void);
01737 CmImage *createImageMaskByCMapIndex(int index);
01749 CmImage *createImageMaskByRGB(int r, int g, int b);
01752 CmImage *createImageMaskByPixel(int x, int y);
01755 void computeBackgroundRGB(int *pr, int *pg, int *pb);
01756 };
01757
01761 class CmCursor {
01762 MTCursor cur;
01763 public:
01764 operator MTCursor() { return cur;}
01766 CmCursor(CmImage *bits, int xs, int ys) {cur=MCreateCursor(bits,xs,ys);}
01767 };
01768
01772 class CmFont {
01773 MTFont font;
01774 int loaded;
01775 public:
01776 operator MTFont() { return font;}
01778 CmFont(int ff=DEFAULT_FONT)
01779 { font = ff; loaded=0;}
01781 CmFont(const char *family, int h, int bold=0, int italic=0);
01782 ~CmFont();
01784 static const char *getFirstFamily(void);
01786 static const char *getNextFamily(void);
01787 };
01788
01789 class CmShell;
01790 class CmForm;
01791 class CmContainer;
01792 class CmObject;
01793
01798 class CmObject : public CmMGUI {
01799
01800 friend class CmOptionEdit;
01801 friend void _ObjectDestroyCB_(MOBJECT p, void *a, void *ud);
01802 friend void _EventPreProcessCB_(MOBJECT p, MEvent *pe, void *ud);
01803
01804 void *user_data;
01805
01806 protected:
01807 MOBJECT obj;
01808 EVENT_CB eventCB;
01809
01810 void reserved(void);
01811 virtual ~CmObject(void);
01812 public:
01813 operator MOBJECT() {return obj; };
01814
01816 inline void drawText(int x, int y, int w, int h, const char *text,
01817 MTFont font, CmColor *fgc, int alignment);
01819 inline void drawNText(int x, int y, int w, int h, const char *text,
01820 MTFont font, CmColor *fgc, int alignment, int n);
01822 inline void drawBGText(int x, int y, int w, int h, const char *text,
01823 MTFont font, CmColor *bgc, CmColor *fgc, int alignment);
01825 inline void drawBGNText(int x, int y, int w, int h, const char *text,
01826 MTFont font, CmColor *bgc, CmColor *fgc, int alignment, int n);
01828 inline void drawShadowedText(int x, int y, int w, int h, const char *text,
01829 MTFont font, int sh, CmColor *fg1, CmColor *fg2, int alignment);
01831 inline void drawShadowedNText(int x, int y, int w, int h, const char *text,
01832 MTFont font, int sh, CmColor *fg1, CmColor *fg2, int alignment, int n);
01834 inline void drawPoint(int x, int y, CmColor *col);
01836 inline void drawLine(int x1, int y1, int x2, int y2, CmColor *col);
01838 inline void drawPolyline(MPOINT *points, int n, CmColor *col);
01840 inline void drawFilledPolyline(MPOINT *points, int n, CmColor *col);
01842 inline void drawBox(int x, int y, int w, int h, CmColor *bgc);
01844 inline void drawFilledBox(int x, int y, int w, int h, CmColor *bgc);
01846 inline void drawCircle(int x, int y, int r, CmColor *col);
01848 inline void drawFilledCircle(int x, int y, int r, CmColor *col);
01850 inline void drawArc(int x, int y, int r, int a1, int a2, CmColor *col);
01852 inline void drawFilledArc(int x, int y, int r, int a1, int a2, CmColor *c);
01854 inline void drawImage(CmImage *gi, int img_x, int img_y, int w, int h,
01855 int x, int y);
01857 inline void drawWindow(void);
01859 inline void drawShadow(void);
01861 inline void drawSubShadow(int x, int y, int w, int h, CmColor *tsc, CmColor *bsc, int thick);
01863 inline void drawBorder(int x, int y, int w, int h, CmColor *col, int thick);
01864
01866 inline void drawXorLine(int x1, int y1, int x2, int y2);
01868 inline void drawXorBox(int x, int y, int w, int h);
01869
01871 inline void setSensitive(void);
01873 inline void setUnsensitive(void);
01875 inline void setSensitivity(int true_false);
01877 inline void setSelectable(void);
01879 inline void setUnselectable(void);
01881 inline void setAutoScrollWhenSelected(int TrueFalse);
01899 inline void setBackgroundColor(CmColor *bgc);
01900
01910 inline void setForegroundColor(CmColor *fgc);
01911
01932 inline void setColor(CmColor *bgc, CmColor *fgc);
01933
01952 inline void setBGColorFromParent(int true_false, int percentage);
01953
01967 inline void setFGColorFromParent(int true_false);
01969 inline void setBackgroundRGB(unsigned r, unsigned g, unsigned b);
01971 inline void setForegroundRGB(unsigned r, unsigned g, unsigned b);
01973 inline void setText(const char *text);
01975 inline void setName(const char *name);
01977 inline void setFont(MTFont font, int resize_obj=0);
01979 inline void setShadow(int type, int in=0, int out=0);
01981 inline void setResize(int resize_w, int resize_h);
01999 inline void setSize(int width, int height);
02005 inline void setMinSize(int width, int height);
02022 inline void setWidth(int width);
02039 inline void setHeight(int height);
02059 inline void setCompositeSize(int width, int height);
02077 inline void setCompositeWidth(int width);
02095 inline void setCompositeHeight(int height);
02111 inline void setPosition(int x, int y);
02123 inline void setX(int x);
02135 inline void setY(int y);
02137 inline void setBackgroundImage(CmImage *gi, int mode);
02139 inline void setBackgroundImageFile(const char *fname, int mode);
02141 inline void setColorFromBackgroundImage(void);
02143 inline void setBGImageMaskByCMapIndex(int id);
02145 inline void setBGImageMaskByPixel(int x, int y);
02147 inline void setBGImageMaskByRGB(int r, int g, int b);
02149 inline void setSolid(void);
02151 inline void setTransparent(void);
02153 inline void setTransparency(CARD8 level);
02155 inline CARD8 getTransparency(void);
02157 inline void setAttachment(int top, int bottom, int left, int right);
02159 inline void setOffset(int t_off, int b_off, int l_off, int r_off);
02161 inline void setCursor(MTCursor cursor);
02163 inline void setPopupHelp(const char *str, int delay, int duration);
02165 inline void setLabelHelp(const char *str, CmObject *label);
02167 inline void setUserData(void *ud) { user_data = ud; };
02169 inline void changePopupHelpText(const char *str);
02171 inline void changeLabelHelpText(const char *str);
02173 inline void topAttach(int att_type, int off, CmObject *obj);
02175 inline void bottomAttach(int att_type, int off, CmObject *obj);
02177 inline void leftAttach(int att_type, int off, CmObject *obj);
02179 inline void rightAttach(int att_type, int off, CmObject *obj);
02181 inline void align(int h_align, int v_align);
02182
02184 inline void getText(char *text);
02186 inline const char *getName(void);
02188 inline void *getUserData(void) { return user_data; };
02190 inline MTFont getFont(void);
02192 inline void getShadow(int *type, int *in, int *out);
02194 inline int isSensitive(void);
02196 inline int isSelectable(void);
02198 inline int isMapped(void);
02200 inline int getWidth(void);
02202 inline int getHeight(void);
02204 inline int getCompositeWidth(void);
02206 inline int getCompositeHeight(void);
02208 inline int getX(void);
02210 inline int getY(void);
02212 inline int usesFGColorFromParent(void);
02214 inline int usesBGColorFromParent(int *percentage_ret);
02221 CmColor *getBackgroundColor(void);
02222
02224 CmColor *getForegroundColor(void);
02225
02227 CmContainer *getParent(void);
02229 CmShell *getShell(void);
02231 inline CmImage *getBackgroundImage(void);
02232
02234 inline void resize(int w, int h);
02236 inline void redraw(void);
02238 inline void select(void);
02240 inline void map(void);
02242 inline void unmap(void);
02244 inline void enableOptions(const char *name, CARD32 mask);
02246 inline void saveOptions(void);
02248 inline void unlink(int resize_obj);
02250 inline void focusLink(CmObject *obj_to_link);
02252 void reparent(CmContainer *new_parent, CmObject *where);
02254 void link(CmContainer *parent, CmObject *where, int resize_parent);
02256 inline void sendEvent(MEvent *pe);
02258 void setEventCallback(CmCallback *pp, EVENT_CB ff, CARD32 mask);
02259 #ifdef WIN_MGUI
02260
02261 inline void print(DOC_ID, MPRINT_OPTIONS *);
02262 #endif
02263 };
02264
02269 class CmContainer : public CmObject {
02270 public:
02272 virtual void addChild(CmObject *child)=0;
02273
02275 CmObject *getSelectedObject(void);
02277 CmObject *getFirstChild(void);
02279 CmObject *getNextChild(void);
02281 int getNChildren(void);
02290 inline void enableSmartDrawing(void);
02297 inline void disableSmartDrawing(void);
02299 void addKeyCallback(CmCallback *, int, MVALUE_CB);
02300 };
02301
02306 class CmShell : public CmContainer {
02307 friend void _WMCloseCB_(MOBJECT p, void *a, void *ud);
02308 VOID_CB closeCB;
02309 public:
02310 ~CmShell(void);
02312 CmShell(const char *text=0, int flags=0);
02313
02315 inline Window getWindow(void);
02316
02318 inline void realize(void);
02320 inline void realize(int x, int y);
02322 inline void realize(int x, int y, int w, int h);
02324 inline void unrealize(void);
02326 inline void raise(void);
02328 void addChild(CmObject *child);
02329
02331 void setWMCloseCallback(CmCallback *pp, VOID_CB ff);
02332 };
02333
02338 class CmForm : public CmContainer {
02339 protected:
02340 CmForm(void){};
02341 public:
02343 inline void setSpacing(int offset);
02345 inline void setFocusWrap(int true_false);
02347 inline void setFocusHighlight(int true_false);
02349 inline void selectFirstChild(void);
02351 inline void selectLastChild(void);
02353 void addChild(CmObject *object);
02355 void setChildSelectCallback(CmCallback *, INT_CB);
02356 };
02357
02362 class CmPosForm : public CmForm {
02363 public:
02365 CmPosForm(CmContainer *parent);
02366 };
02367
02372 class CmRowForm : public CmForm {
02373 public:
02375 CmRowForm(CmContainer *parent);
02376 };
02377
02381 class CmColForm : public CmForm {
02382 public:
02384 CmColForm(CmContainer *parent);
02385 };
02386
02390 class CmAbsTableForm : public CmForm {
02391 public:
02393 inline void showGrid(void);
02395 inline void hideGrid(void);
02397 inline void setRowHeight(int row, int height);
02399 inline void setColWidth(int col, int width);
02401 inline void setColFont(int col, MTFont f);
02403 inline void setColAlign(int col, int al);
02405 inline void setRowAlign(int row, int al);
02407 inline void setColBackgroundRGB(int col, int r, int g, int b);
02409 inline void setColForegroundRGB(int col, int r, int g, int b);
02411 inline void setCellText(int x, int y, const char *text);
02413 inline void getCellText(int x, int y, char *text);
02415 inline void setCellFont(int x, int y, MTFont f);
02417 inline void setCellAlign(int x, int y, int h_al, int v_al);
02419 inline void setCellBackgroundRGB(int x, int y, int r, int g, int b);
02421 inline void setCellForegroundRGB(int x, int y, int r, int g, int b);
02423 CmObject *getCellObject(int x, int y);
02425 inline void deleteRow(int row);
02427 inline void deleteDataRows(void);
02428 };
02429
02433 class CmTableForm : public CmAbsTableForm {
02434 public:
02435 CmTableForm(CmContainer *parent, int n_columns);
02436 };
02437
02438
02442 class CmScrolledTableForm : public CmAbsTableForm {
02443 public:
02445 CmScrolledTableForm(CmContainer *parent, int n_columns,
02446 int clip_w, int clip_h, int head_rows=0, int head_cols=0);
02447 };
02448
02452 class CmAbsPagedForm : public CmForm {
02453 friend void _NewPageCB_(MOBJECT p, MVALUE a, void *ud);
02454 INT_CB newPageCB;
02455 public:
02457 inline void setActivePage(int page);
02459 inline int getActivePage(void);
02461 inline void setNPages(int npages);
02463 inline void disablePageKeys(void);
02465 inline void enablePageKeys(void);
02467 void setActivePageCallback(CmCallback *, INT_CB);
02468 };
02469
02473 class CmAbsTabbedForm : public CmAbsPagedForm {
02474 public:
02475 inline void setTabText(int page, const char *text);
02476 inline void getTabText(int page, char *text);
02477 };
02478
02482 class CmPagedPosForm : public CmAbsPagedForm {
02483 public:
02485 CmPagedPosForm(CmContainer *parent, int n_pages);
02486 };
02487
02491 class CmPagedRowForm : public CmAbsPagedForm {
02492 public:
02494 CmPagedRowForm(CmContainer *parent, int n_pages);
02495 };
02496
02500 class CmPagedColForm : public CmAbsPagedForm {
02501 public:
02503 CmPagedColForm(CmContainer *parent, int n_pages);
02504 };
02505
02509 class CmPagedPosFormExt : public CmAbsPagedForm {
02510 public:
02512 CmPagedPosFormExt(CmContainer *parent, int n_pages);
02513 };
02514
02518 class CmPagedRowFormExt : public CmAbsPagedForm {
02519 public:
02521 CmPagedRowFormExt(CmContainer *parent, int n_pages);
02522 };
02523
02527 class CmPagedColFormExt : public CmAbsPagedForm {
02528 public:
02530 CmPagedColFormExt(CmContainer *parent, int n_pages);
02531 };
02532
02536 class CmTabbedPosForm : public CmAbsTabbedForm {
02537 public:
02539 CmTabbedPosForm(CmContainer *parent, int n_pages, MTFont f=HELV_SMALL);
02540 };
02541
02545 class CmTabbedRowForm : public CmAbsTabbedForm {
02546 public:
02548 CmTabbedRowForm(CmContainer *parent, int n_pages, MTFont f=HELV_SMALL);
02549 };
02550
02554 class CmTabbedColForm : public CmAbsTabbedForm {
02555 public:
02557 CmTabbedColForm(CmContainer *parent, int n_pages, MTFont f=HELV_SMALL);
02558 };
02559
02563 class CmAbsCForm : public CmForm {
02564 public:
02566 inline void setClipX(int clip_x);
02568 inline void setClipY(int clip_y);
02570 inline int getClipX(void);
02572 inline int getClipY(void);
02574 inline void setSliderColor(CmColor *cc);
02576 inline void setSliderColorShift(int perc);
02577 };
02578
02582 class CmAbsScrolledForm : public CmAbsCForm {
02583 public:
02585 inline void setIncr(int h_inc, int v_inc);
02587 inline void setSliderColor(CmColor *cc);
02589 inline void setSliderColorShift(int perc);
02599 inline void enableAutoSliderColor(void);
02606 inline void disableAutoSliderColor(void);
02607 };
02608
02612 class CmScrolledPosForm : public CmAbsScrolledForm {
02613 public:
02615 CmScrolledPosForm(CmContainer *parent, int w, int h);
02616 };
02617
02621 class CmScrolledRowForm : public CmAbsScrolledForm {
02622 public:
02624 CmScrolledRowForm(CmContainer *parent, int w, int h);
02625 };
02626
02630 class CmScrolledColForm : public CmAbsScrolledForm {
02631 public:
02633 CmScrolledColForm(CmContainer *parent, int w, int h);
02634 };
02635
02639 class CmClippedPosForm : public CmAbsCForm {
02640 public:
02642 CmClippedPosForm(CmContainer *parent, int w, int h);
02643 };
02644
02648 class CmClippedRowForm : public CmAbsCForm {
02649 public:
02651 CmClippedRowForm(CmContainer *parent, int w, int h);
02652 };
02653
02657 class CmClippedColForm : public CmAbsCForm {
02658 public:
02660 CmClippedColForm(CmContainer *parent, int w, int h);
02661 };
02662
02667 class CmLabel : public CmObject {
02668 public:
02670 CmLabel(CmContainer *parent, const char *text=0, MTFont font=DEFAULT_FONT);
02672 void setMargin(int wm, int hm);
02674 void setHSpacing(int hs);
02676 void setAlignment(int alignment);
02677 };
02678
02683 class CmAbsEdit : public CmObject {
02684 friend void _EditNewValueCB_(MOBJECT p, char *text, void *ud);
02685 friend void _EditValueChangeCB_(MOBJECT p, EDIT_CHANGE *ec, void *ud);
02686 STRING_CB newValueCB;
02687 EDITCHANGE_CB valueChangeCB;
02688 protected:
02689 CmAbsEdit(void){};
02690 public:
02692 void changeText(int off, int len, const char *new_t, int chg_len);
02694 void getSubString(int start, int end, char *str);
02696 int findSubStringForward(int off, const char *str, int icase);
02698 int findSubStringBackward(int off, const char *str, int icase);
02700 void setSelection(int start, int end);
02702 void getSelection(int *pstart, int *pend);
02704 char *getAllocatedText(void);
02706 void setCursorPos(int pos);
02708 int getCursorPos(void);
02718 void enableAutoControlColor(void);
02725 void disableAutoControlColor(void);
02727 void setNewValueCallback(CmCallback *, STRING_CB);
02729 void setValueChangeCallback(CmCallback *, EDITCHANGE_CB);
02730 };
02731
02736 class CmAbsEditField : public CmAbsEdit {
02737 friend void _EditActCB_(MOBJECT p, char *text, void *ud);
02738 friend void _EditValCB_(MOBJECT p, EDIT_VAL *ev, void *ud);
02739 friend void _EditHotKeyCB_(MOBJECT p, void *a, void *ud);
02740 STRING_CB activateCB;
02741 EDITVAL_CB validateCB;
02742 VOID_CB hotKeyCB;
02743 protected:
02744 CmAbsEditField(void){};
02745 public:
02747 inline void setMargin(int w_margin, int h_margin);
02749 void setFilter(int filter, const char *extra_chars);
02751 void setTextExt(const char *text, int validated, int notify);
02753 void setValidatedColors(CmColor *bgc, CmColor *fgc);
02755 void setInvalidatedColors(CmColor *bgc, CmColor *fgc);
02757 void setValidationStatus(int validated);
02759 inline void setBufferSize(const char *text, int clip_size, int size);
02761 void selectForReplace(void);
02763 inline void disableEditing(void);
02765 inline void enableEditing(void);
02767 const char *text(void);
02769 int getFilter(void);
02771 int isValidated(void);
02772
02774 void setActivateCallback(CmCallback *, STRING_CB);
02776 void setHotKeyCallback(CmCallback *, VOID_CB, int);
02778 void setValidateCallback(CmCallback *, EDITVAL_CB);
02779 };
02780
02785 class CmEditField : public CmAbsEditField {
02786 public:
02788 CmEditField(CmContainer *parent, const char *text, int len,
02789 int clip_len=-1, MTFont font=DEFAULT_FONT);
02790 };
02791
02795 class CmHiddenEditField : public CmAbsEditField {
02796 public:
02798 CmHiddenEditField(CmContainer *parent, const char *text, int len,
02799 int clip_len=-1, MTFont font=DEFAULT_FONT, char shown='*');
02800 };
02801
02805 class CmSpinEditField : public CmAbsEditField {
02806 friend void _SpinCB_(MOBJECT p, MVALUE a, void *ud);
02807 INT_CB spinCB;
02808 public:
02810 CmSpinEditField(CmContainer *parent, const char *text, int len,
02811 int clip_len, MTFont font,
02812 CmCallback *owner, INT_CB cb);
02813 };
02814
02818 class CmAbsEditWindow : public CmAbsEdit {
02819 friend void _EditCursorCB_(MOBJECT p, EDIT_CURS *ec, void *ud);
02820 EDITCURS_CB cursCB;
02821 public:
02823 void setCursorXY(int x, int y);
02825 void getCursorXY(int *px, int *py);
02827 void setAutoIndent(int on_off);
02829 void setTabSize(int size);
02831 void setClipWindow(int clip_w, int clip_h);
02833 void setCursorCallback(CmCallback *, EDITCURS_CB);
02834 };
02835
02840 class CmEditWindow : public CmAbsEditWindow {
02841 public:
02843 CmEditWindow(CmContainer *parent, const char *text, int width, int height,
02844 MTFont font=DEFAULT_FONT);
02845 };
02846
02850 class CmScrolledEditWindow : public CmAbsEditWindow {
02851 public:
02853 CmScrolledEditWindow(CmContainer *parent, const char *text, int width, int height,
02854 MTFont font=DEFAULT_FONT);
02856 inline void setSliderColor(CmColor *cc);
02858 inline void setSliderColorShift(int perc);
02859 };
02860
02865 class CmAbsButton : public CmObject {
02866 public:
02868 void setImages(const char *normal, const char *arm=0, const char *unsens=0);
02870 void changeImageFiles(const char *normal, const char *arm, const char *unsens,
02871 const char *norm_on, const char *arm_on, const char *uns_on);
02873 inline CmImage *changeNormalImage(CmImage *new_normal);
02875 inline CmImage *changeArmedImage(CmImage *new_armed);
02877 inline CmImage *changeUnsensitiveImage(CmImage *new_unsens);
02879 inline CmImage *changeNormalOnImage(CmImage *new_normal_on);
02881 inline CmImage *changeArmedOnImage(CmImage *new_armed_on);
02883 inline CmImage *changeUnsensitiveOnImage(CmImage *new_unsens_on);
02885 inline void setTextVsImageAlignment(CARD8 align);
02887 inline void setOnMouseOverForegroundColor(CmColor *fgc);
02889 inline void setOnMouseOverForegroundRGB(int r, int g, int b);
02891 inline void setShadowOnMouseOver(int thick);
02893 inline void setAccelerator(int key);
02895 inline void setImageMaskByCMapIndex(int id);
02897 inline void setImageMaskByPixel(int x, int y);
02899 inline void setImageMaskByRGB(int r, int g, int b);
02901 inline void unsetOnMouseOverForeground(void);
02903 inline void unShadowOnMouseOver(void);
02904 };
02905
02910 class CmPushButton : public CmAbsButton {
02911 friend void _PushButtonActivateCB_(MOBJECT p, void *a, void *ud);
02912 VOID_CB activateCB;
02913 public:
02915 CmPushButton(CmContainer *p, const char *text, MTFont font=DEFAULT_FONT);
02917 CmPushButton(CmContainer *p, CmImage *norm, CmImage *arm=0, CmImage *uns=0);
02919 CmPushButton(CmContainer *p, const char *norm, const char *arm, const char *uns=0);
02921 CmPushButton(CmContainer *p,
02922 CmImage *norm, CmImage *arm, CmImage *uns,
02923 CmImage *norm_on, CmImage *arm_on, CmImage *uns_on);
02925 CmPushButton(CmContainer *p,
02926 const char *norm, const char *arm, const char *uns,
02927 const char *norm_on, const char *arm_on, const char *uns_on);
02929 CmPushButton(CmContainer *p, const char *text, MTFont font,
02930 CmImage *norm, CmImage *arm, CmImage *uns,
02931 CmImage *norm_on, CmImage *arm_on, CmImage *uns_on);
02933 CmPushButton(CmContainer *p, const char *text, MTFont font,
02934 const char *norm, const char *arm, const char *uns,
02935 const char *norm_on, const char *arm_on, const char *uns_on);
02937 void setRepeatDelay(int first, int repeat);
02939 void setMargin(int wm, int hm);
02941 void setHSpacing(int hs);
02943 void setAlignment(int alignment);
02945 void setAccelerator(int key);
02947 void setCallback(CmCallback *owner, VOID_CB cb);
02948 };
02949
02954 class CmToggleButton : public CmAbsButton {
02955 friend void _ToggleButtonActivateCB_(MOBJECT p, MVALUE a, void *ud);
02956 INT_CB activateCB;
02957 public:
02959 CmToggleButton(CmContainer *par, const char *text, MTFont font=DEFAULT_FONT);
02961 CmToggleButton(CmContainer *p, CmImage *n, CmImage *arm=0, CmImage *uns=0);
02963 CmToggleButton(CmContainer *par, const char *normal, const char *on_arm, const char *uns=0);
02965 CmToggleButton(CmContainer *p,
02966 CmImage *norm, CmImage *arm, CmImage *uns,
02967 CmImage *norm_on, CmImage *arm_on, CmImage *uns_on);
02969 CmToggleButton(CmContainer *p,
02970 const char *norm, const char *arm, const char *uns,
02971 const char *norm_on, const char *arm_on, const char *uns_on);
02973 CmToggleButton(CmContainer *p, const char *text, MTFont font,
02974 CmImage *norm, CmImage *arm, CmImage *uns,
02975 CmImage *norm_on, CmImage *arm_on, CmImage *uns_on);
02977 CmToggleButton(CmContainer *p, const char *text, MTFont font,
02978 const char *norm, const char *arm, const char *uns,
02979 const char *norm_on, const char *arm_on, const char *uns_on);
02981 void arm(void);
02983 void disarm(void);
02984
02986 int isArmed(void);
02987
02989 void setCallback(CmCallback *owner, INT_CB cb);
02990 };
02991
02996 class CmRadioButton : public CmAbsButton {
02997 friend void _RadioButtonActivateCB_(MOBJECT p, MVALUE a, void *ud);
02998 INT_CB activateCB;
02999 public:
03001 CmRadioButton(CmContainer *par, const char *text, MTFont font=DEFAULT_FONT);
03003 CmRadioButton(CmContainer *p, CmImage *norm, CmImage *arm=0, CmImage *uns=0);
03005 CmRadioButton(CmContainer *par, const char *normal, const char *on_arm, const char *when_unsens=0);
03007 CmRadioButton(CmContainer *p,
03008 CmImage *norm, CmImage *arm, CmImage *uns,
03009 CmImage *norm_on, CmImage *arm_on, CmImage *uns_on);
03011 CmRadioButton(CmContainer *p,
03012 const char *norm, const char *arm, const char *uns,
03013 const char *norm_on, const char *arm_on, const char *uns_on);
03015 CmRadioButton(CmContainer *p, const char *text, MTFont font,
03016 CmImage *norm, CmImage *arm, CmImage *uns,
03017 CmImage *norm_on, CmImage *arm_on, CmImage *uns_on);
03019 CmRadioButton(CmContainer *p, const char *text, MTFont font,
03020 const char *norm, const char *arm, const char *uns,
03021 const char *norm_on, const char *arm_on, const char *uns_on);
03023 void arm(void);
03025 void disarm(void);
03026
03028 int isArmed(void);
03029
03031 void setCallback(CmCallback *owner, INT_CB cb);
03032 };
03033
03038 class CmPixmap : public CmObject {
03039 public:
03041 CmPixmap(CmContainer *par, CmImage *normal);
03043 CmPixmap(CmContainer *par, const char *fname);
03044
03046 void setImage(CmImage *normal);
03048 void setImage(const char *fname);
03049 };
03050
03054 class CmDrawArea : public CmObject {
03055 friend void _DrawAreaExposeCB_(MOBJECT, MEvent *, void *);
03056 friend void _DrawAreaInputCB_(MOBJECT, MEvent *, void *);
03057 friend void _DrawAreaResizeCB_(MOBJECT, DRAWAREA_PREF *, void *);
03058 EVENT_CB exposeCB;
03059 EVENT_CB inputCB;
03060 DRAWAREAPREF_CB resizeCB;
03061 public:
03063 CmDrawArea(CmContainer *parent, int w, int h);
03064
03066 void setExposeCallback(CmCallback *, EVENT_CB);
03068 void setInputCallback(CmCallback *, EVENT_CB);
03070 void setResizeCallback(CmCallback *, DRAWAREAPREF_CB);
03071 };
03072
03077 class CmStatusBar : public CmObject {
03078 public:
03080 CmStatusBar(CmContainer *parent, const char *text=0, int max=10, MTFont font=DEFAULT_FONT);
03081
03083 void setMax(int max);
03085 void setWidth(int width);
03087 void setPos(int pos);
03089 inline void setSliderColor(CmColor *col);
03091 inline void setSliderColorShift(int perc);
03093 inline void setSliderRGB(int r, int g, int b);
03094 };
03095
03110 class CmSplitter : public CmObject {
03111 public:
03112 CmSplitter(CmContainer *parent);
03113 };
03114
03119 class CmScrollBar : public CmObject {
03120 friend void _ScrollBarValueCB_(MOBJECT p, MVALUE a, void *ud);
03121 LONG_CB changeCB;
03122 public:
03124 CmScrollBar(CmContainer *parent, int type, long n, long max);
03125
03127 void setMax(long max);
03129 void setPos(long pos);
03131 void setN(long n);
03133 void setIncr(int incr);
03135 inline void setSliderColor(CmColor *cc);
03137 void setValues(long max, long n, long pos);
03139 long getMax(void);
03141 long getPos(void);
03143 long getN(void);
03144
03146 void setCallback(CmCallback *, LONG_CB);
03147 };
03148
03153 class CmSFile : public CmObject {
03154 public:
03156 CmSFile(CmContainer *parent, const char *fname, MTFont font=DEFAULT_FONT,
03157 int nrow=10, int ncol=20);
03158
03160 void setFile(const char *fname);
03162 void CmSFile::setHMargin(int hm);
03163 };
03164
03169 class CmAbsList : public CmObject {
03170 friend class CmOptionEdit;
03171 friend void _ListActivateCB_(MOBJECT p, LIST_ACT *la, void *ud);
03172 friend void _ListPickCB_(MOBJECT p, LIST_ACT *la, void *ud);
03173 friend void _ListSelectionCB_(MOBJECT p, LIST_SEL *la, void *ud);
03174 LISTACT_CB activateCB;
03175 LISTACT_CB pickCB;
03176 LISTSEL_CB selectionCB;
03177 protected:
03178 CmAbsList(void){};
03179 public:
03181 void setSortCallback(STRCMP_CB cb);
03183 void setHead(const char *text);
03185 void setHeadColor(CmColor *bgc, CmColor *fgc);
03187 void setHMargin(int hm);
03189 void setItemCheckStatus(const char *item, int status);
03191 void setHighLightColors(CmColor *bgc, CmColor *fgc);
03193 inline void setHighLightFGColor(CmColor *fgc);
03195 inline void setSliderColor(CmColor *cc);
03197 inline void setSliderColorShift(int perc);
03207 inline void enableAutoSliderColor(void);
03214 inline void disableAutoSliderColor(void);
03216 LIST_ACT *getFirstItem(void);
03218 LIST_ACT *getFirstSelectedItem(void);
03220 LIST_ACT *getNextItem(void);
03222 LIST_ACT *getNextSelectedItem(void);
03224 LIST_ACT *getFirstUnselectedItem(void);
03226 LIST_ACT *getNextUnselectedItem(void);
03228 long getNItem(void);
03230 LIST_ACT *getItem(const char *item);
03232 LIST_ACT *getElement(long n);
03234 LIST_ACT *getSelected(void);
03236 int getItemCheckStatus(const char *item);
03238 void getHead(char *buff);
03239
03241 void selectItem(const char *item);
03243 void deselectItem(const char *item);
03245 void selectElement(long n);
03247 void deselectElement(long n);
03249 void freeze(void);
03251 void thaw(void);
03253 void reset(void);
03255 void clear(void);
03257 int addItem(const char *item, void *data);
03259 int delItem(const char *item);
03261 int addElement(long n, const char *item, void *data);
03263 int delElement(long n);
03265 void changeItem(const char *old, const char *new_item, void *u_data);
03267 void changeElement(long n, const char *new_item, void *u_data);
03269 void enableMultiSelection(void);
03271 inline void disableMultiSelection(void);
03273 inline void disableItemMotion(void);
03275 inline void enableItemMotion(void);
03277 void setCallback(CmCallback *, LISTACT_CB);
03279 void setPickCallback(CmCallback *, LISTACT_CB);
03281 void setSelectionCallback(CmCallback *, LISTSEL_CB);
03282 };
03283
03287 class CmSList : public CmAbsList {
03288 public:
03290 CmSList(CmContainer *parent, MTFont font, int row_len,
03291 int nrow, int ncol);
03292 };
03293
03297 class CmEditList : public CmAbsList {
03298 public:
03300 CmEditList(CmContainer *parent, MTFont font, EL_TEMPLATE *elt,
03301 int ne, int nrow, int ncol);
03303 int addItem(char **argv, void *u_data);
03305 int addItemFromEdits(void *u_data);
03307 void changeElement(long n, char **new_ele, void *data);
03309 void delElement(long n);
03311 void seekItem(char **argv, long *pos, void **u_data);
03313 void getItemField(const char *item, int ii, char *buff);
03315 void getEditText(int ii, char *buff);
03317 void setEditText(int ii, const char *buff);
03318 };
03319
03323 class CmClippedSList : public CmAbsList {
03324 friend void _ClippedListNewBlockCB_(MOBJECT, SBL_NEW_BLOCK *, void *);
03325 friend void _ClippedListItemSeekCB_(MOBJECT, SBL_ITEM_SEEK *, void *);
03326 NEWBLOCK_CB newBlockCB;
03327 ITEMSEEK_CB itemSeekCB;
03328 public:
03330 CmClippedSList(CmContainer *parent,
03331 CmCallback *owner, NEWBLOCK_CB nb, ITEMSEEK_CB is,
03332 MTFont font, int nrow, int ncol, int xc, long xn=0);
03333 };
03334
03339 class CmOptionEdit : public CmAbsEditField {
03340 CmAbsList *slist;
03341 public:
03342 ~CmOptionEdit(void);
03344 CmOptionEdit(CmContainer *parent, const char *text, int len, int clip_len=-1,
03345 int nrow=10, MTFont font=DEFAULT_FONT);
03347 CmAbsList *getSList(void) { return slist; };
03349 void setListCallback(CmCallback *pp, LISTACT_CB cb);
03350 };
03351
03356 class CmMenuBar : public CmObject {
03357 public:
03359 CmMenuBar(CmContainer *parent, MTFont font);
03361 void setAcceleratorKey(int key);
03363 void setHighLightColors(CmColor *bgc, CmColor *fgc);
03365 void setHighLightFGColor(CmColor *fgc);
03366
03367 };
03368
03369 class CmMenu;
03370
03374 class CmMenuLine : public CmMGUI {
03375 protected:
03376 friend class CmMenu;
03377 MENU_ITEM id;
03378 MOBJECT pdobj;
03379 CmMenuLine *next;
03380 virtual ~CmMenuLine(void) {}
03381 };
03382
03386 class CmMenuSeparator : public CmMenuLine {
03387 public:
03389 CmMenuSeparator(CmMenu *pd);
03390 };
03391
03395 class CmAbsMenuItem : public CmMenuLine {
03396 friend class CmMenu;
03397 friend void _MenuItemActivateCB_(MENU_ITEM item, MVALUE status, void *ud);
03398 MENUITEM_CB itemCB;
03399 CmCallback *owner;
03400 protected:
03401 CmAbsMenuItem(CmMenu *pd, CmCallback *ff, MENUITEM_CB cb);
03402 public:
03404 void setText(const char *text);
03406 void setSensitive(void);
03408 void setUnsensitive(void);
03410 void setAcceleratorKey(int key, const char *a_text=0);
03412 int setCheckStatus(int true_false);
03414 int getCheckStatus(void);
03416 const char *getText(void);
03418 CmMenu *getMenu(void);
03420 int toggleCheckStatus(void);
03421 };
03422
03426 class CmMenuItem : public CmAbsMenuItem {
03427 public:
03429 CmMenuItem(CmMenu *pd, const char *text, CmCallback *ff=0, MENUITEM_CB cb=0, int acc=0, const char *at=0);
03430 };
03431
03435 class CmMenuRadioItem : public CmAbsMenuItem {
03436 public:
03438 CmMenuRadioItem(CmMenu *pd, const char *text, CmCallback *ff=0, MENUITEM_CB cb=0, int acc=0, const char *at=0);
03439 };
03440
03444 class CmMenuToggleItem : public CmAbsMenuItem {
03445 public:
03447 CmMenuToggleItem(CmMenu *pd, const char *text, CmCallback *ff=0, MENUITEM_CB cb=0, int acc=0, const char *at=0);
03448 };
03449
03455 class CmMenu : public CmObject {
03456 friend class CmMenuSeparator;
03457 friend class CmAbsMenuItem;
03458 CmMenuLine *list;
03459 ITEMSEL_CB itemSelCB;
03460 public:
03461 virtual ~CmMenu(void);
03463 CmMenu(CmMenuBar *menu, const char *title);
03465 CmMenu(CmMenuItem *it);
03467 CmMenu(MTFont font=HELV_MEDIUM);
03469 void setText(const char *text);
03471 const char *getText(void);
03473 void popup(int x, int y);
03475 void setHighLightColors(CmColor *bgc, CmColor *fgc);
03477 void setHighLightFGColor(CmColor *fgc);
03479 void setItemSelectionCallback(CmCallback *, ITEMSEL_CB);
03480 };
03481
03482 class CmTreeNode;
03483
03490 class CmTree : public CmObject {
03491 MTREENODE_CB openCB;
03492 MTREENODE_CB closeCB;
03493 MTREENODE_CB selectCB;
03494 MTREEPOPUP_CB popupCB;
03495 MTREERENAME_CB renameCB;
03496 MTREEDELETE_CB deleteCB;
03497 public:
03513 CmTree(CmContainer *parent, MTFont font, int width, int height, int n_types);
03514
03531 inline void setImages(int type, const char *norm, const char *open, const char *sel);
03532
03549 inline void setImages(int type, CmImage *norm, CmImage *open, CmImage *sel);
03550
03560 inline void setHighLightColors(CmColor *bgc, CmColor *fgc);
03561
03568 inline void setHighLightFGColor(CmColor *fgc);
03569
03576 inline void setLineColor(CmColor *color);
03577
03584 inline void setSliderColor(CmColor *color);
03585
03593 inline void setSliderColorShift(int percentage);
03603 inline void enableAutoSliderColor(void);
03610 inline void disableAutoSliderColor(void);
03614 CmTreeNode *getSelectedNode(void);
03615
03619 CmTreeNode *getFirstNode(void);
03620
03629 void setOpenCallback(CmCallback *owner, MTREENODE_CB cb);
03638 void setCloseCallback(CmCallback *owner, MTREENODE_CB cb);
03647 void setSelectCallback(CmCallback *owner, MTREENODE_CB cb);
03648
03659 void setPopupCallback(CmCallback *owner, MTREEPOPUP_CB cb);
03660
03673 void setRenameCallback(CmCallback *owner, MTREERENAME_CB cb);
03685 void setDeleteCallback(CmCallback *owner, MTREEDELETE_CB cb);
03686 };
03687
03692 class CmTreeNode : public CmMGUI {
03693 MTNODE node;
03694 MTREENODE_CB openCB;
03695 MTREENODE_CB closeCB;
03696 MTREENODE_CB selectCB;
03697 MTREEPOPUP_CB popupCB;
03698 MTREERENAME_CB renameCB;
03699 MTREEDELETE_CB deleteCB;
03700 public:
03716 CmTreeNode(CmTree *tree, CmTreeNode *parent, CARD16 type, CARD16 flags,
03717 const char *text);
03718
03725 inline void destroyContainee(int notify);
03726
03732 inline void open(int notify);
03733
03739 inline void close(int notify);
03740
03747 inline void select(int notify);
03748
03750 CmTreeNode *getNext(void);
03752 CmTreeNode *getFirstChild(void);
03754 CmTreeNode *getParent(void);
03755
03767 inline char *getPath(char separator, char *buff);
03768
03783 inline void setImages(CmImage *norm, CmImage *open, CmImage *sel);
03784
03791 inline void setText(const char *text);
03792
03803 inline char *getText(char *text);
03804
03806 inline CARD16 getType(void);
03807
03815 inline void edit(void);
03824 void setOpenCallback(CmCallback *owner, MTREENODE_CB cb);
03825
03834 void setCloseCallback(CmCallback *owner, MTREENODE_CB cb);
03835
03844 void setSelectCallback(CmCallback *owner, MTREENODE_CB cb);
03855 void setPopupCallback(CmCallback *owner, MTREEPOPUP_CB cb);
03856
03869 void setRenameCallback(CmCallback *owner, MTREERENAME_CB cb);
03870
03882 void setDeleteCallback(CmCallback *owner, MTREEDELETE_CB cb);
03883 };
03884
03885
03889 class CmDirBrowser : public CmObject {
03890 friend void _DirChangeCB_(MOBJECT p, const char *dir, void *ud);
03891 public:
03892
03914 CmDirBrowser(CmContainer *parent, const char *dir,
03915 MTFont font, int width, int height, CARD16 flags);
03916
03925 inline void setDirectory (const char *dir, int notify);
03926
03928 inline const char *getDirectory (void);
03929
03931 void setDirChangeCallback (CmCallback *owner, DBDIRCHANGE_CB cb);
03932 };
03933
03934 #endif