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