3207ea9c1f
* BUG: Fix a backtrace memory leak in error management. * BUG: Fix a memory leak in process streams. [GB.FORM] * BUG: Some bug fixes in DatePicker. It does not work correctly with gb.gtk yet! [GB.GTK] * BUG: Fix the container arrangement and the ClientX / ClientY properties. * BUG: A form is not its own event observer if one was specified at instanciation time. [GB.QT] * OPT: The container arrangement is now triggered the same way as in gb.gtk. No Qt event filter is used anymore. [GB.QT4] * OPT: The container arrangement optimization from gb.qt has been partially applied to gb.qt4. git-svn-id: svn://localhost/gambas/trunk@1858 867c0c6c-44f3-4631-809d-bfa615b0a4ec
92 lines
2.1 KiB
C++
92 lines
2.1 KiB
C++
#ifndef __GCONTAINER_H
|
|
#define __GCONTAINER_H
|
|
|
|
#include "gcontrol.h"
|
|
|
|
struct gContainerArrangement
|
|
{
|
|
unsigned mode : 8;
|
|
unsigned padding : 8;
|
|
unsigned spacing : 8;
|
|
unsigned locked : 1;
|
|
unsigned user : 1;
|
|
unsigned dirty : 1;
|
|
unsigned autoresize : 1;
|
|
unsigned margin : 1;
|
|
unsigned _reserved : 3;
|
|
};
|
|
|
|
class gContainer : public gControl
|
|
{
|
|
public:
|
|
gContainer();
|
|
gContainer(gContainer *parent);
|
|
~gContainer();
|
|
|
|
int arrange();
|
|
bool autoResize();
|
|
bool isUser() { return arrangement.user; }
|
|
int padding();
|
|
bool spacing();
|
|
bool margin();
|
|
virtual int clientWidth();
|
|
virtual int clientHeight();
|
|
virtual int clientX();
|
|
virtual int clientY();
|
|
virtual int containerX();
|
|
virtual int containerY();
|
|
|
|
void setArrange(int vl);
|
|
void setUser(bool vl);
|
|
void setAutoResize(bool vl);
|
|
void setPadding(int vl);
|
|
void setSpacing(bool vl);
|
|
void setMargin(bool vl);
|
|
|
|
virtual int childCount();
|
|
virtual gControl* child(int index);
|
|
gControl *find(int x, int y);
|
|
|
|
gContainerArrangement *getArrangement() { return &arrangement; }
|
|
gContainerArrangement fullArrangement() { return arrangement; }
|
|
void setFullArrangement(gContainerArrangement &arr) { arrangement = arr; performArrange(); }
|
|
|
|
virtual void performArrange();
|
|
|
|
virtual void setBackground(gColor color = COLOR_DEFAULT);
|
|
virtual void setForeground(gColor color = COLOR_DEFAULT);
|
|
|
|
virtual void resize(int w, int h);
|
|
|
|
virtual void setVisible(bool vl);
|
|
|
|
gContainer *proxy() { return _proxy ? _proxy : this; }
|
|
void setProxy(gContainer *proxy) { if (proxy != this) _proxy = proxy; else _proxy = 0; }
|
|
|
|
//"Signals"
|
|
void (*onArrange)(gContainer *sender);
|
|
void (*onBeforeArrange)(gContainer *sender);
|
|
//void (*onInsert)(gContainer *sender, gControl *child);
|
|
|
|
//"Private"
|
|
GtkWidget *radiogroup;
|
|
GList *ch_list;
|
|
int _client_w, _client_h;
|
|
|
|
virtual void insert(gControl *child, int x, int y) { insert(child); move(x, y); }
|
|
virtual void insert(gControl *child);
|
|
virtual void remove(gControl *child);
|
|
virtual GtkWidget *getContainer();
|
|
gControl *findFirstFocus();
|
|
void updateFocusChain();
|
|
|
|
static int _arrangement_level;
|
|
|
|
private:
|
|
void initialize();
|
|
gContainerArrangement arrangement;
|
|
gContainer *_proxy;
|
|
};
|
|
|
|
#endif
|