16f7a0cb8b
[GB.GTK] * NEW: Centered is a new container property that centered its contents. It works for horizontal, vertical and fill arrangement only. * BUG: Setting Application.Font to NULL now resets the default font. * BUG: Resizable utility windows now have a minimum size like QT components. [GB.GTK3] * NEW: Centered is a new container property that centered its contents. It works for horizontal, vertical and fill arrangement only. * BUG: Setting Application.Font to NULL now resets the default font. * OPT: Setting Application.Font now is almost instantaneous. * BUG: Editable combo-boxes having a small width now behave correctly. * BUG: Resizable utility windows now have a minimum size like QT components. * BUG: Read-only combo-boxes do not have inner vertical padding anymore. [GB.QT4] * NEW: Centered is a new container property that centered its contents. It works for horizontal, vertical and fill arrangement only. [GB.QT5] * NEW: Centered is a new container property that centered its contents. It works for horizontal, vertical and fill arrangement only. * BUG: Fix TextArea background.
169 lines
3.4 KiB
C++
169 lines
3.4 KiB
C++
/***************************************************************************
|
|
|
|
CPanel.cpp
|
|
|
|
(c) 2000-2017 Benoît Minisini <g4mba5@gmail.com>
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
MA 02110-1301, USA.
|
|
|
|
***************************************************************************/
|
|
|
|
#define __CPANEL_CPP
|
|
|
|
#include <qapplication.h>
|
|
#include <qobject.h>
|
|
|
|
#include "gambas.h"
|
|
|
|
#include "CConst.h"
|
|
#include "CPanel.h"
|
|
|
|
BEGIN_METHOD(CPANEL_new, GB_OBJECT parent)
|
|
|
|
MyContainer *wid = new MyContainer(QCONTAINER(VARG(parent)));
|
|
THIS->container = wid;
|
|
|
|
//THIS->widget.flag.fillBackground = true;
|
|
CWIDGET_new(wid, (void *)_object);
|
|
|
|
END_METHOD
|
|
|
|
|
|
BEGIN_METHOD(CHBOX_new, GB_OBJECT parent)
|
|
|
|
MyContainer *wid = new MyContainer(QCONTAINER(VARG(parent)));
|
|
|
|
THIS->container = wid;
|
|
THIS->arrangement.mode = ARRANGE_HORIZONTAL;
|
|
//THIS->arrangement.autoresize = true;
|
|
|
|
CWIDGET_new(wid, (void *)_object);
|
|
|
|
END_METHOD
|
|
|
|
|
|
BEGIN_METHOD(CVBOX_new, GB_OBJECT parent)
|
|
|
|
MyContainer *wid = new MyContainer(QCONTAINER(VARG(parent)));
|
|
|
|
THIS->container = wid;
|
|
THIS->arrangement.mode = ARRANGE_VERTICAL;
|
|
//THIS->arrangement.autoresize = true;
|
|
|
|
CWIDGET_new(wid, (void *)_object);
|
|
|
|
END_METHOD
|
|
|
|
|
|
BEGIN_METHOD(CHPANEL_new, GB_OBJECT parent)
|
|
|
|
MyContainer *wid = new MyContainer(QCONTAINER(VARG(parent)));
|
|
|
|
THIS->container = wid;
|
|
THIS->arrangement.mode = ARRANGE_ROW;
|
|
//THIS->arrangement.autoresize = true;
|
|
|
|
CWIDGET_new(wid, (void *)_object);
|
|
|
|
END_METHOD
|
|
|
|
|
|
BEGIN_METHOD(CVPANEL_new, GB_OBJECT parent)
|
|
|
|
MyContainer *wid = new MyContainer(QCONTAINER(VARG(parent)));
|
|
|
|
THIS->container = wid;
|
|
THIS->arrangement.mode = ARRANGE_COLUMN;
|
|
//THIS->arrangement.autoresize = true;
|
|
|
|
CWIDGET_new(wid, (void *)_object);
|
|
|
|
END_METHOD
|
|
|
|
|
|
|
|
GB_DESC CPanelDesc[] =
|
|
{
|
|
GB_DECLARE("Panel", sizeof(CPANEL)), GB_INHERITS("Container"),
|
|
|
|
GB_METHOD("_new", NULL, CPANEL_new, "(Parent)Container;"),
|
|
|
|
GB_PROPERTY("Border", "i", Container_Border),
|
|
|
|
ARRANGEMENT_PROPERTIES,
|
|
|
|
PANEL_DESCRIPTION,
|
|
|
|
GB_END_DECLARE
|
|
};
|
|
|
|
|
|
GB_DESC CHBoxDesc[] =
|
|
{
|
|
GB_DECLARE("HBox", sizeof(CPANEL)), GB_INHERITS("Container"),
|
|
|
|
GB_METHOD("_new", NULL, CHBOX_new, "(Parent)Container;"),
|
|
|
|
ARRANGEMENT_FLAG_PROPERTIES,
|
|
|
|
HBOX_DESCRIPTION,
|
|
|
|
GB_END_DECLARE
|
|
};
|
|
|
|
|
|
GB_DESC CVBoxDesc[] =
|
|
{
|
|
GB_DECLARE("VBox", sizeof(CPANEL)), GB_INHERITS("Container"),
|
|
|
|
GB_METHOD("_new", NULL, CVBOX_new, "(Parent)Container;"),
|
|
|
|
ARRANGEMENT_FLAG_PROPERTIES,
|
|
|
|
VBOX_DESCRIPTION,
|
|
|
|
GB_END_DECLARE
|
|
};
|
|
|
|
|
|
GB_DESC CHPanelDesc[] =
|
|
{
|
|
GB_DECLARE("HPanel", sizeof(CPANEL)), GB_INHERITS("Container"),
|
|
|
|
GB_METHOD("_new", NULL, CHPANEL_new, "(Parent)Container;"),
|
|
|
|
ARRANGEMENT_FLAG_PROPERTIES,
|
|
|
|
HPANEL_DESCRIPTION,
|
|
|
|
GB_END_DECLARE
|
|
};
|
|
|
|
|
|
GB_DESC CVPanelDesc[] =
|
|
{
|
|
GB_DECLARE("VPanel", sizeof(CPANEL)), GB_INHERITS("Container"),
|
|
|
|
GB_METHOD("_new", NULL, CVPANEL_new, "(Parent)Container;"),
|
|
|
|
ARRANGEMENT_FLAG_PROPERTIES,
|
|
|
|
VPANEL_DESCRIPTION,
|
|
|
|
GB_END_DECLARE
|
|
};
|
|
|
|
|