86fd86e68b
* BUG: Searching backward inside a subroutine should not freeze anymore. [GB.GTK] * BUG: TrayIcons do not raise events anymore if a modal dialog is shown. * BUG: If no toplevel menu is visible, then the window menubar is hidden. * BUG: As in gb.gt, toplevel menus with no text (separators) are hidden. * BUG: The TrayIcons _next and _get special methods do not crash anymore. * BUG: Buttons color properties now should work as expected. git-svn-id: svn://localhost/gambas/trunk@1726 867c0c6c-44f3-4631-809d-bfa615b0a4ec
72 lines
1.4 KiB
C++
72 lines
1.4 KiB
C++
#ifndef __GBUTTON_H
|
|
#define __GBUTTON_H
|
|
|
|
class gButton : public gControl
|
|
{
|
|
public:
|
|
|
|
enum Type
|
|
{
|
|
Button, Toggle, Check, Radio, Tool
|
|
};
|
|
|
|
gButton(gContainer *parent, Type type);
|
|
~gButton();
|
|
|
|
bool getBorder();
|
|
bool isCancel();
|
|
bool isDefault();
|
|
const char* text();
|
|
gPicture* picture();
|
|
bool value();
|
|
bool isToggle();
|
|
bool isRadio();
|
|
bool enabled();
|
|
bool inconsistent();
|
|
bool isStretch() { return _stretch; }
|
|
|
|
void setEnabled(bool vl);
|
|
void setBorder(bool vl);
|
|
void setCancel(bool vl);
|
|
void setDefault(bool vl);
|
|
void setText(const char *st);
|
|
void setPicture(gPicture *pic);
|
|
void setValue(bool vl);
|
|
void setToggle(bool vl);
|
|
void setRadio(bool vl);
|
|
void setInconsistent(bool vl);
|
|
void setStretch(bool vl);
|
|
|
|
virtual void setFont(gFont *ft);
|
|
virtual void setForeground(gColor color);
|
|
|
|
//"Method"
|
|
void animateClick(bool on);
|
|
|
|
//"Signals"
|
|
void (*onClick)(gControl *sender);
|
|
|
|
//"Private"
|
|
int type;
|
|
char *bufText;
|
|
GtkCellRenderer *rendtxt;
|
|
GtkWidget *label;
|
|
GdkPixbuf *rendpix,*rendinc;
|
|
gPicture *pic;
|
|
int shortcut;
|
|
unsigned scaled : 1;
|
|
unsigned disable : 1;
|
|
unsigned _toggle : 1;
|
|
unsigned _animated : 1;
|
|
unsigned _radio : 1;
|
|
unsigned _stretch : 1;
|
|
|
|
bool hasShortcut();
|
|
void unsetOtherRadioButtons();
|
|
virtual int minimumHeight();
|
|
|
|
static bool isButton(gControl *control) { return control->getClass() == Type_gButton && ((gButton *)control)->type == Button; }
|
|
};
|
|
|
|
#endif
|