3b852d1d93
* BUG: UserControl and UserContainer _Container properties are correctly implemented now. Consequently, the gb.form containers start working as expected. * BUG: Window.Background and Window.Foreground now work correctly when the window is embedded. * BUG: ClientX, ClientY, ClientW and ClientH container properties for Panel now take the frame into account, as in gb.qt. git-svn-id: svn://localhost/gambas/trunk@1673 867c0c6c-44f3-4631-809d-bfa615b0a4ec
86 lines
2.0 KiB
C++
86 lines
2.0 KiB
C++
#ifndef __GCONTAINER_H
|
|
#define __GCONTAINER_H
|
|
|
|
#include "gcontrol.h"
|
|
|
|
struct gContainerArrangement
|
|
{
|
|
unsigned char mode;
|
|
unsigned char spacing;
|
|
unsigned char padding;
|
|
unsigned autoresize:1;
|
|
unsigned locked:1;
|
|
unsigned user:1;
|
|
unsigned dirty:1;
|
|
unsigned _reserved:4;
|
|
};
|
|
|
|
class gContainer : public gControl
|
|
{
|
|
public:
|
|
gContainer();
|
|
gContainer(gContainer *parent);
|
|
~gContainer();
|
|
|
|
int arrange();
|
|
bool autoResize();
|
|
bool isUser() { return arrangement.user; }
|
|
int padding();
|
|
int spacing();
|
|
virtual int clientWidth();
|
|
virtual int clientHeight();
|
|
virtual int clientX();
|
|
virtual int clientY();
|
|
|
|
void setArrange(int vl);
|
|
void setUser(bool vl);
|
|
void setAutoResize(bool vl);
|
|
void setPadding(int vl);
|
|
void setSpacing(int 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 (*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
|