|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef TW_INCLUDED
|
|
Toshihiro Shimizu |
890ddd |
#define TW_INCLUDED
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "traster.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef DVAPI
|
|
Toshihiro Shimizu |
890ddd |
#undef DVVAR
|
|
Toshihiro Shimizu |
890ddd |
#ifdef TWIN_EXPORTS
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_EXPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_EXPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_IMPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_IMPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TMouseEvent;
|
|
Toshihiro Shimizu |
890ddd |
class TCursor;
|
|
Toshihiro Shimizu |
890ddd |
class TDragDropListener;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class DVAPI TGuiColor {
|
|
Shinya Kitaoka |
120a6e |
int m_red, m_green, m_blue;
|
|
Shinya Kitaoka |
120a6e |
// mutable void* m_imp;
|
|
Shinya Kitaoka |
120a6e |
// bool m_isStock;
|
|
Shinya Kitaoka |
120a6e |
// int m_shade;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// TUINT32 *m_index;
|
|
Shinya Kitaoka |
120a6e |
// mutable bool m_allocated;
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
// static const int m_maxShade;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TGuiColor(int r, int g, int b);
|
|
Shinya Kitaoka |
120a6e |
TGuiColor();
|
|
Shinya Kitaoka |
120a6e |
~TGuiColor();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// TGuiColor(const TGuiColor&);
|
|
Shinya Kitaoka |
120a6e |
// TGuiColor& operator=(const TGuiColor&);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// TUINT32 getIndex(int shade=0) const;
|
|
Shinya Kitaoka |
120a6e |
// TUINT32 getRGB(int shade=0) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
int red() const { return m_red; }
|
|
Shinya Kitaoka |
120a6e |
int green() const { return m_green; }
|
|
Shinya Kitaoka |
120a6e |
int blue() const { return m_blue; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void computeShade(int index, int &r, int &g, int &b) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// void* imp() const {return m_imp;}
|
|
Shinya Kitaoka |
120a6e |
// void imp(void* imp) const { m_imp = imp; }
|
|
Shinya Kitaoka |
120a6e |
// bool isStock() const { return m_isStock; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
void initStockColor();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TWidgetImp;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// class TTarget {};
|
|
Shinya Kitaoka |
120a6e |
// class TTimerTarget {};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TWidget;
|
|
Toshihiro Shimizu |
890ddd |
typedef std::vector<twidget *=""> TWidgetList;</twidget>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TWidget
|
|
Toshihiro Shimizu |
890ddd |
// : public TTarget, public TTimerTarget
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
enum Alignment { BEGIN, CENTER, END };
|
|
Shinya Kitaoka |
120a6e |
enum FocusHandling { IGNORE_FOCUS, STOP_FOCUS, LISTEN_TO_FOCUS };
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
TRect m_placement;
|
|
Shinya Kitaoka |
120a6e |
int m_xoff, m_yoff;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
bool m_mapped; // e' arrivato il MapNotify
|
|
Shinya Kitaoka |
120a6e |
bool m_hidden; // il widget non vuole mostrarsi
|
|
Shinya Kitaoka |
120a6e |
bool m_childrenChanged;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// TTimer *m_timer;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TWidget *m_parent, *m_sonKeeper;
|
|
Shinya Kitaoka |
120a6e |
std::string m_name, m_contextHelpReference;
|
|
Shinya Kitaoka |
120a6e |
std::wstring m_shortHelp, m_longHelp;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
int m_cursorIdx;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TWidgetList *m_sons;
|
|
Shinya Kitaoka |
120a6e |
TWidgetImp *m_imp;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
friend class TWidgetImp;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TGuiColor m_backgroundColor, m_foregroundColor;
|
|
Shinya Kitaoka |
120a6e |
bool m_popupMode, m_menuMode, m_fixedSize, m_fullColor, m_openGL;
|
|
Shinya Kitaoka |
120a6e |
bool m_enabled, m_menuRelated;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TDragDropListener *m_dragDropListener;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
std::string m_fontName;
|
|
Shinya Kitaoka |
120a6e |
int m_fontSize;
|
|
Shinya Kitaoka |
120a6e |
int m_fontOrientation;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
static TWidget *m_selectionOwner;
|
|
Shinya Kitaoka |
120a6e |
static TWidget *m_focusOwner;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// not implemented (cannot copy and assign widget)
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
TWidget(const TWidget &);
|
|
Shinya Kitaoka |
120a6e |
TWidget &operator=(const TWidget &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
virtual void create();
|
|
Shinya Kitaoka |
120a6e |
virtual void setDecoration();
|
|
Shinya Kitaoka |
120a6e |
virtual void destroyImp();
|
|
Shinya Kitaoka |
120a6e |
void createSons();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
TWidget(TWidget *parent = 0, std::string name = "unnamed");
|
|
Shinya Kitaoka |
120a6e |
virtual ~TWidget();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// geometry
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
const TRect &getGeometry() const { return m_placement; }
|
|
Shinya Kitaoka |
120a6e |
TPoint getPosition() const { return m_placement.getP00(); }
|
|
Shinya Kitaoka |
120a6e |
virtual TPoint getHotSpot() const { return TPoint(0, 0); }
|
|
Shinya Kitaoka |
120a6e |
TDimension getSize() const { return m_placement.getSize(); }
|
|
Shinya Kitaoka |
120a6e |
TRect getBounds() const { return TRect(TPoint(), getSize()); }
|
|
Shinya Kitaoka |
120a6e |
int getLx() const { return m_placement.getLx(); }
|
|
Shinya Kitaoka |
120a6e |
int getLy() const { return m_placement.getLy(); }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
inline void setPlacement(const TRect &rect) { m_placement = rect; }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
inline void setGeometry(int x0, int y0, int x1, int y1) {
|
|
Shinya Kitaoka |
120a6e |
setGeometry(TRect(x0, y0, x1, y1));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void setGeometry(const TRect &rect);
|
|
Shinya Kitaoka |
120a6e |
void setGeometry(const TPoint &pos, const TDimension &size) {
|
|
Shinya Kitaoka |
120a6e |
setGeometry(TRect(pos, size));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
inline void setSize(int w, int h) {
|
|
Shinya Kitaoka |
120a6e |
setGeometry(getPosition(), TDimension(w, h));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
inline void setSize(const TDimension &size) { setSize(size.lx, size.ly); }
|
|
Shinya Kitaoka |
120a6e |
inline void setPosition(int x, int y) {
|
|
Shinya Kitaoka |
120a6e |
setGeometry(TPoint(x, y), getSize());
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
inline void setPosition(const TPoint &pt) { setGeometry(pt, getSize()); }
|
|
Shinya Kitaoka |
120a6e |
inline bool contains(int x, int y) const { return contains(TPoint(x, y)); }
|
|
Shinya Kitaoka |
120a6e |
inline bool contains(const TPoint &p) const {
|
|
Shinya Kitaoka |
120a6e |
return m_placement.contains(p);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TPoint getScreenPosition() const;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// name, parent & sons
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
inline TWidget *getParent() const { return m_parent; }
|
|
Shinya Kitaoka |
120a6e |
inline std::string getName() const { return m_name; }
|
|
Shinya Kitaoka |
120a6e |
virtual void setParent(TWidget *p);
|
|
Shinya Kitaoka |
120a6e |
virtual void addSon(TWidget *son);
|
|
Shinya Kitaoka |
120a6e |
virtual void removeSon(TWidget *son);
|
|
Shinya Kitaoka |
120a6e |
inline int getSonCount() const { return m_sons->size(); }
|
|
Shinya Kitaoka |
120a6e |
inline TWidget *getSon(int i) const {
|
|
Shinya Kitaoka |
120a6e |
return i < 0 || i >= (int)(m_sons->size()) ? 0 : (*m_sons)[i];
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// help messages
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
std::wstring getLongHelp() const;
|
|
Shinya Kitaoka |
120a6e |
std::wstring getShortHelp() const;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setHelp(std::string shortHelp, std::string longHelp);
|
|
Shinya Kitaoka |
120a6e |
void setHelp(std::wstring shortHelp, std::wstring longHelp);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual std::string getContextHelpReference(const TPoint &) {
|
|
Shinya Kitaoka |
120a6e |
return m_contextHelpReference;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setContextHelpReference(std::string s) { m_contextHelpReference = s; }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// void delegateHelpToParent();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual std::wstring getTooltipString(const TPoint &) {
|
|
Shinya Kitaoka |
120a6e |
return getShortHelp();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// misc
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
inline bool isHidden() const { return m_hidden; }
|
|
Shinya Kitaoka |
120a6e |
inline bool isMapped() const { return m_mapped; }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void enable();
|
|
Shinya Kitaoka |
120a6e |
void disable();
|
|
Shinya Kitaoka |
120a6e |
inline bool isEnabled() const { return m_enabled; }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void show();
|
|
Shinya Kitaoka |
120a6e |
void hide();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// n.b. non chiamare map/unmap, ma show/hide
|
|
Shinya Kitaoka |
120a6e |
virtual void map();
|
|
Shinya Kitaoka |
120a6e |
virtual void unmap();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void doModal();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void undock();
|
|
Shinya Kitaoka |
120a6e |
virtual void dock(TWidget *parent);
|
|
Shinya Kitaoka |
120a6e |
virtual TWidget *findSubWidget(const TPoint &pt);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void repaint();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void sendRepaint() { sendRepaint(getBounds()); }
|
|
Shinya Kitaoka |
120a6e |
void sendRepaint(const TRect &);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void paste();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void startDragAndDrop(std::string stringToDrop);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
typedef unsigned int CursorIndex;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
inline CursorIndex getCurrentCursor() { return m_cursorIdx; }
|
|
Shinya Kitaoka |
120a6e |
void changeCursor(CursorIndex new_cur);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TWidgetImp *getImp() { return m_imp; }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void startTimer(TINT32 period);
|
|
Shinya Kitaoka |
120a6e |
void stopTimer();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void getSelection();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void onFocusChange(bool on);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual bool getFocus() { return false; }
|
|
Shinya Kitaoka |
120a6e |
virtual void circulateFocus();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void copyRegion(const TPoint &dst, const TPoint &src,
|
|
Shinya Kitaoka |
120a6e |
const TDimension &size);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// draw
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
void flush();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void draw() {}
|
|
Shinya Kitaoka |
120a6e |
virtual void invalidate();
|
|
Shinya Kitaoka |
120a6e |
virtual void invalidate(const TRect &rect);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void getClipRect(TRect &rect);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void clear();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawText(const TPoint &p, std::string text);
|
|
Shinya Kitaoka |
120a6e |
virtual void drawText(const TPoint &p, std::wstring text);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawText(const TRect &r, std::string text,
|
|
Shinya Kitaoka |
120a6e |
Alignment alignment = CENTER);
|
|
Shinya Kitaoka |
120a6e |
virtual void drawText(const TRect &r, std::wstring text,
|
|
Shinya Kitaoka |
120a6e |
Alignment alignment = CENTER);
|
|
Shinya Kitaoka |
120a6e |
virtual void drawMultiLineText(const TRect &r, std::string text);
|
|
Shinya Kitaoka |
120a6e |
virtual void drawMultiLineText(const TRect &r, std::wstring text);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual TDimension getTextSize(std::string text);
|
|
Shinya Kitaoka |
120a6e |
virtual TDimension getTextSize(std::wstring text);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual TDimension getTextSize(std::string text, std::string font,
|
|
Shinya Kitaoka |
120a6e |
int fontSize);
|
|
Shinya Kitaoka |
120a6e |
virtual TDimension getTextSize(std::wstring text, std::string font,
|
|
Shinya Kitaoka |
120a6e |
int fontSize);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
inline void drawPoint(int x, int y) { drawLine(x, y, x, y); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawLine(const TPoint &p0, const TPoint &p1);
|
|
Shinya Kitaoka |
120a6e |
inline void drawLine(int x0, int y0, int x1, int y1) {
|
|
Shinya Kitaoka |
120a6e |
drawLine(TPoint(x0, y0), TPoint(x1, y1));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual void drawVLine(const TPoint &p0, int length) {
|
|
Shinya Kitaoka |
120a6e |
drawLine(p0, p0 + TPoint(0, length - 1));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual void drawHLine(const TPoint &p0, int length) {
|
|
Shinya Kitaoka |
120a6e |
drawLine(p0, p0 + TPoint(length - 1, 0));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawDottedLine(const TPoint &p0, const TPoint &p1);
|
|
Shinya Kitaoka |
120a6e |
inline void drawDottedLine(int x0, int y0, int x1, int y1) {
|
|
Shinya Kitaoka |
120a6e |
drawDottedLine(TPoint(x0, y0), TPoint(x1, y1));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawRect(const TRect &);
|
|
Shinya Kitaoka |
120a6e |
virtual void fillRect(const TRect &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawRect(int x0, int y0, int x1, int y1) {
|
|
Shinya Kitaoka |
120a6e |
drawRect(TRect(x0, y0, x1, y1));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual void fillRect(int x0, int y0, int x1, int y1) {
|
|
Shinya Kitaoka |
120a6e |
fillRect(TRect(x0, y0, x1, y1));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void draw3DRect(const TRect &, bool pressed = false, int border = 1);
|
|
Shinya Kitaoka |
120a6e |
virtual void fill3DRect(const TRect &, bool pressed = false, int border = 1);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawDottedRect(const TRect &);
|
|
Shinya Kitaoka |
120a6e |
virtual void drawDottedRect(int x0, int y0, int x1, int y1) {
|
|
Shinya Kitaoka |
120a6e |
drawDottedRect(TRect(x0, y0, x1, y1));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void fillPolygon(const TGuiColor &fillColor,
|
|
Shinya Kitaoka |
120a6e |
const TGuiColor &borderColor, const TPoint points[],
|
|
Shinya Kitaoka |
120a6e |
int pointCount);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void clear(const TRect &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawImage(int index, const TPoint &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void setColor(const TGuiColor &, int shade = 0);
|
|
Shinya Kitaoka |
120a6e |
virtual void setBackgroundColor(const TGuiColor &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TGuiColor getBackgroundColor() const { return m_backgroundColor; }
|
|
Shinya Kitaoka |
120a6e |
TGuiColor getForegroundColor() const { return m_foregroundColor; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
static const TGuiColor White;
|
|
Shinya Kitaoka |
120a6e |
static const TGuiColor Black;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void rectwrite(const TRaster32P &, const TPoint &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void setFontSize(int size);
|
|
Shinya Kitaoka |
120a6e |
virtual void setFont(std::string name, int size = 0, int orientation = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// events
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void enter(const TPoint &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void leave(const TPoint &) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void mouseMove(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void leftButtonDown(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void leftButtonDrag(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void leftButtonUp(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void rightButtonDown(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void rightButtonDrag(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void rightButtonUp(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void middleButtonDown(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void middleButtonDrag(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void middleButtonUp(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void leftButtonDoubleClick(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void middleButtonDoubleClick(const TMouseEvent &) {}
|
|
Shinya Kitaoka |
120a6e |
virtual void rightButtonDoubleClick(const TMouseEvent &) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void mouseWheel(const TMouseEvent &, int wheel) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void keyDown(int, TUINT32, const TPoint &) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void configureNotify(const TDimension &) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void onPaste(std::string) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// virtual void close() {unmap();}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void onDrop(std::string) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual std::string getToolTip() { return ""; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void onTimer(int) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void onChildrenChanged() {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual bool onNcPaint(bool is_active, const TDimension &window_size,
|
|
Shinya Kitaoka |
120a6e |
const TRect &caption_rect);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
static void setFocusOwner(TWidget *w);
|
|
Shinya Kitaoka |
120a6e |
static TWidget *getFocusOwner();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual FocusHandling getFocusHandling() const { return IGNORE_FOCUS; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
static void placeInteractively(TRect &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// brutto brutto qui
|
|
Shinya Kitaoka |
120a6e |
virtual void maximize(TWidget *) {}
|
|
Shinya Kitaoka |
120a6e |
virtual bool isMaximized(TWidget *) { return false; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// drag & drop
|
|
Shinya Kitaoka |
120a6e |
//
|
|
Shinya Kitaoka |
120a6e |
// virtual bool acceptDrop() {return false;}
|
|
Shinya Kitaoka |
120a6e |
void enableDropTarget(TDragDropListener *dragDropListener);
|
|
Shinya Kitaoka |
120a6e |
TDragDropListener *getDragDropListener() const { return m_dragDropListener; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
static void yield(); // processa tutti gli eventi in attesa
|
|
Shinya Kitaoka |
120a6e |
static void setMode(int mode);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// misc
|
|
Shinya Kitaoka |
120a6e |
TPoint getAbsolutePosition() const;
|
|
Shinya Kitaoka |
120a6e |
static TPoint getMouseAbsolutePosition();
|
|
Shinya Kitaoka |
120a6e |
TPoint getMouseRelativePosition() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// brutto. serve per filtrare gli eventi durante il menu event loop
|
|
Shinya Kitaoka |
120a6e |
bool isMenuRelated() const { return m_menuRelated; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// se non altro e' brutto il nome
|
|
Shinya Kitaoka |
120a6e |
// NB: il nome e' brutto... ora questo e' anche sbagliato
|
|
Shinya Kitaoka |
120a6e |
static void processAllPendingMessages(); // questa processa solo i WM_PAINT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
static void processAllPendingMessages2(); // questa processa tutto
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// mah? serve a evitare il circuito invalidate() -> repaint(); chiama
|
|
Shinya Kitaoka |
120a6e |
// direttamente
|
|
Shinya Kitaoka |
120a6e |
// repaint() (creando l'opportuno GC su windows)
|
|
Shinya Kitaoka |
120a6e |
// void paintRegion(const TRect &rect);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
static TDimension getScreenSize();
|
|
Shinya Kitaoka |
120a6e |
static void getScreenPlacement(std::vector<trecti> &);</trecti>
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif
|