diff --git a/gb.gtk/src/CContainer.cpp b/gb.gtk/src/CContainer.cpp index 80b04666b..358567baa 100644 --- a/gb.gtk/src/CContainer.cpp +++ b/gb.gtk/src/CContainer.cpp @@ -95,6 +95,16 @@ void CUSERCONTROL_cb_draw(gContainer *sender, GdkRegion *region, int dx, int dy) #endif } +void CUSERCONTROL_cb_font(gContainer *sender) +{ + CWIDGET *_object = GetObject(sender); + GB_FUNCTION func; + + if (!GB.GetFunction(&func, THIS, "UserControl_Font", NULL, NULL)) + GB.Call(&func, 0, TRUE); + else + GB.Error(NULL); +} static void get_client_area(gContainer *cont, int *x, int *y, int *w, int *h) { diff --git a/gb.gtk/src/CLabel.cpp b/gb.gtk/src/CLabel.cpp deleted file mode 100644 index 50da87290..000000000 --- a/gb.gtk/src/CLabel.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************** - - CLabel.cpp - - (c) 2004-2006 - Daniel Campos Fernández - - 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 __CLABEL_CPP - -#include - -#include "gambas.h" -#include "widgets.h" -#include "CLabel.h" -#include "CContainer.h" - - -BEGIN_METHOD(CLABEL_new, GB_OBJECT parent) - - InitControl(new gLabel(CONTAINER(VARG(parent))),(CWIDGET*)THIS); - -END_METHOD - -BEGIN_METHOD(CTEXTLABEL_new, GB_OBJECT parent) - - InitControl(new gLabel(CONTAINER(VARG(parent))),(CWIDGET*)THIS); - - WIDGET->setWrap(true); - WIDGET->setMarkup(true); - WIDGET->setAlignment(ALIGN_TOP_NORMAL); - -END_METHOD - -BEGIN_PROPERTY(CLABEL_auto_resize) - - if (READ_PROPERTY) - GB.ReturnBoolean(WIDGET->autoResize()); - else - WIDGET->setAutoResize(VPROP(GB_BOOLEAN)); - -END_PROPERTY - - -BEGIN_PROPERTY(CLABEL_text) - - if (READ_PROPERTY) - GB.ReturnNewZeroString(WIDGET->text()); - else - WIDGET->setText(GB.ToZeroString(PROP(GB_STRING))); - -END_PROPERTY - -BEGIN_PROPERTY(CLABEL_border) - - if (READ_PROPERTY) - GB.ReturnInteger(WIDGET->getFrameBorder()); - else - WIDGET->setFrameBorder(VPROP(GB_INTEGER)); - -END_PROPERTY - -BEGIN_PROPERTY(CLABEL_alignment) - - if (READ_PROPERTY) - GB.ReturnInteger(WIDGET->alignment()); - else - WIDGET->setAlignment(VPROP(GB_INTEGER)); - -END_PROPERTY - - -BEGIN_PROPERTY(CLABEL_transparent) - - if (READ_PROPERTY) - GB.ReturnBoolean(WIDGET->isTransparent()); - else - WIDGET->setTransparent(VPROP(GB_BOOLEAN)); - -END_PROPERTY - -BEGIN_PROPERTY(CLABEL_padding) - - if (READ_PROPERTY) - GB.ReturnInteger(WIDGET->padding()); - else - WIDGET->setPadding(VPROP(GB_INTEGER)); - -END_PROPERTY - -BEGIN_METHOD_VOID(CLABEL_adjust) - - WIDGET->adjust(); - -END_METHOD - -BEGIN_PROPERTY(Label_Wrap) - - if (READ_PROPERTY) - GB.ReturnBoolean(WIDGET->wrap()); - else - WIDGET->setWrap(VPROP(GB_BOOLEAN)); - -END_PROPERTY - - - -GB_DESC CLabelDesc[] = -{ - GB_DECLARE("Label", sizeof(CLABEL)), GB_INHERITS("Control"), - - GB_METHOD("_new", 0, CLABEL_new, "(Parent)Container;"), - - GB_PROPERTY("Text", "s", CLABEL_text), - GB_PROPERTY("Caption", "s", CLABEL_text), - GB_PROPERTY("Alignment", "i", CLABEL_alignment), - GB_PROPERTY("Border", "i", CLABEL_border), - GB_PROPERTY("AutoResize", "b", CLABEL_auto_resize), - GB_PROPERTY("Transparent","b",CLABEL_transparent), - GB_PROPERTY("Padding", "i", CLABEL_padding), - GB_METHOD("Adjust", 0, CLABEL_adjust, 0), - - LABEL_DESCRIPTION, - - GB_END_DECLARE -}; - - -GB_DESC CTextLabelDesc[] = -{ - GB_DECLARE("TextLabel", sizeof(CLABEL)), GB_INHERITS("Control"), - - GB_METHOD("_new", 0, CTEXTLABEL_new, "(Parent)Container;"), - - GB_PROPERTY("Text", "s", CLABEL_text), - GB_PROPERTY("Caption", "s", CLABEL_text), - GB_PROPERTY("Alignment", "i", CLABEL_alignment), - GB_PROPERTY("Border", "i", CLABEL_border), - GB_PROPERTY("AutoResize", "b", CLABEL_auto_resize), - GB_PROPERTY("Transparent","b",CLABEL_transparent), - GB_PROPERTY("Wrap","b",Label_Wrap), - GB_PROPERTY("Padding", "i", CLABEL_padding), - GB_METHOD("Adjust", 0, CLABEL_adjust, 0), - - TEXTLABEL_DESCRIPTION, - - GB_END_DECLARE -}; - - - diff --git a/gb.gtk/src/CLabel.h b/gb.gtk/src/CLabel.h deleted file mode 100644 index 7d78cad6b..000000000 --- a/gb.gtk/src/CLabel.h +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - - CLabel.h - - (c) 2004-2006 - Daniel Campos Fernández - - 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. - -***************************************************************************/ - -#ifndef __CLABEL_H -#define __CLABEL_H - -#include "main.h" -#include "CWidget.h" -#include "glabel.h" - -#ifndef __CLABEL_CPP -extern GB_DESC CLabelDesc[]; -extern GB_DESC CTextLabelDesc[]; - -#else - -#define THIS ((CLABEL *)_object) -#define WIDGET ((gLabel*)THIS->ob.widget) - -#endif - -typedef - struct - { - CWIDGET ob; - } - CLABEL; - -#endif diff --git a/gb.gtk/src/Makefile.am b/gb.gtk/src/Makefile.am index af8aa4de8..3bf43bab3 100644 --- a/gb.gtk/src/Makefile.am +++ b/gb.gtk/src/Makefile.am @@ -16,7 +16,7 @@ gb_gtk_la_SOURCES = \ gfont.cpp gpicture.cpp \ gdesktop.cpp gdialog.cpp \ gcontrol.cpp gcontainer.cpp \ - gbutton.cpp gslider.cpp glabel.cpp gsignals.cpp \ + gbutton.cpp gslider.cpp gsignals.cpp \ gcombobox.cpp gtextbox.cpp gtextarea.cpp \ gpanel.cpp gtabstrip.cpp \ gmenu.cpp gtrayicon.cpp gmainwindow.cpp \ @@ -38,7 +38,6 @@ gb_gtk_la_SOURCES = \ CWatcher.h CWatcher.cpp \ CWidget.h CWidget.cpp CContainer.h CContainer.cpp \ CDrawingArea.h CDrawingArea.cpp \ - CLabel.h CLabel.cpp \ CSlider.h CSlider.cpp \ CButton.h CButton.cpp \ CTextBox.h CTextBox.cpp \ @@ -60,7 +59,6 @@ gb_gtk_la_SOURCES = \ gseparator.h \ gtrayicon.h \ gplugin.h \ - glabel.h \ gbutton.h \ gcombobox.h \ gtextbox.h \ diff --git a/gb.gtk/src/gcontainer.cpp b/gb.gtk/src/gcontainer.cpp index 9bebd8c23..5b414de8d 100644 --- a/gb.gtk/src/gcontainer.cpp +++ b/gb.gtk/src/gcontainer.cpp @@ -427,6 +427,7 @@ void gContainer::setUser() void gContainer::setPaint() { + arrangement.paint = true; ON_DRAW_BEFORE(border, this, cb_expose, cb_draw); } @@ -795,6 +796,9 @@ void gContainer::updateFont() for (i = 0; i < childCount(); i++) child(i)->updateFont(); + + if (arrangement.paint) + CUSERCONTROL_cb_font(this); } void gContainer::moveChild(gControl *child, int x, int y) diff --git a/gb.gtk/src/gcontainer.h b/gb.gtk/src/gcontainer.h index 620889c66..e3600b425 100644 --- a/gb.gtk/src/gcontainer.h +++ b/gb.gtk/src/gcontainer.h @@ -31,6 +31,7 @@ void CUSERCONTROL_cb_draw(gContainer *sender, cairo_t *cr); #else void CUSERCONTROL_cb_draw(gContainer *sender, GdkRegion *region, int dx, int dy); #endif +void CUSERCONTROL_cb_font(gContainer *sender); struct gContainerArrangement { @@ -45,7 +46,8 @@ struct gContainerArrangement unsigned dirty : 1; unsigned autoresize : 1; unsigned invert : 1; - unsigned _reserved: 11; + unsigned paint : 1; + unsigned _reserved: 10; }; class gContainer : public gControl diff --git a/gb.gtk/src/gfont.cpp b/gb.gtk/src/gfont.cpp index dc2c41180..ac52bc530 100644 --- a/gb.gtk/src/gfont.cpp +++ b/gb.gtk/src/gfont.cpp @@ -573,15 +573,17 @@ const char *gFont::toFullString() void gFont::textSize(const char *text, int len, float *w, float *h) { PangoLayout *ly; - PangoRectangle rect = { 0 }; + PangoRectangle ink_rect, rect = { 0 }; if (text && len) { ly = pango_layout_new(ct); pango_layout_set_text(ly, text, len); gt_set_layout_from_font(ly, this); - pango_layout_get_extents(ly, NULL, &rect); + pango_layout_get_extents(ly, &ink_rect, &rect); g_object_unref(ly); + rect.width = Max(rect.width, ink_rect.width); + rect.height = Max(rect.height, ink_rect.height); } if (w) *w = (float)rect.width / PANGO_SCALE; diff --git a/gb.gtk/src/glabel.cpp b/gb.gtk/src/glabel.cpp deleted file mode 100644 index dc05afd7c..000000000 --- a/gb.gtk/src/glabel.cpp +++ /dev/null @@ -1,385 +0,0 @@ -/*************************************************************************** - - glabel.cpp - - (c) 2004-2006 - Daniel Campos Fernández - - 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. - -***************************************************************************/ - -#include "widgets.h" -#include "glabel.h" - -#ifdef GTK3 -static gboolean cb_draw(GtkWidget *draw, cairo_t *cr, gLabel *d) -{ - GdkRGBA rgba; - int vw, vh, lw, lh; - int fw = d->getFramePadding() + d->getFrameWidth(); - int xa = d->lay_x; - - //d->drawBackground(cr); - d->drawBorder(cr); - - gt_from_color(d->realForeground(true), &rgba); - gdk_cairo_set_source_rgba(cr, &rgba); - - if (xa == 3) - { - if (gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL) - xa = 2; - else - xa = 0; - } - - switch (xa) - { - case 0: pango_layout_set_alignment(d->layout, PANGO_ALIGN_LEFT); break; - case 1: pango_layout_set_alignment(d->layout, PANGO_ALIGN_CENTER); break; - case 2: pango_layout_set_alignment(d->layout, PANGO_ALIGN_RIGHT); break; - } - - vw = d->width(); - vh = d->height(); - - gt_layout_get_extents(d->layout, &lw, &lh); - - if (!d->markup() || !d->wrap()) - { - switch (xa) - { - case 0: vw = fw; break; - case 1: vw = (vw - lw) / 2; break; - case 2: vw = vw - lw - fw; break; - } - } - else - vw = fw; - - switch (d->lay_y) - { - case 0: vh = fw; break; - case 1: vh = (vh - lh) / 2; break; - case 2: vh = vh - lh - fw; break; - } - - if (vh < 0) vh = 0; - - //vw += draw->allocation.x; - //vh += draw->allocation.y; - - cairo_move_to(cr, vw, vh); - pango_cairo_show_layout(cr, d->layout); - - return false; -} -#else -static gboolean cb_expose(GtkWidget *draw, GdkEventExpose *e, gLabel *d) -{ - GtkStyle *style = gtk_widget_get_style(draw); - cairo_t *cr; - int vw, vh, lw, lh; - int fw = d->getFramePadding() + d->getFrameWidth(); - int xa = d->lay_x; - - cr = gdk_cairo_create(draw->window); - gdk_cairo_region(cr, e->region); - cairo_clip(cr); - - if (style) - gdk_cairo_set_source_color(cr, &style->fg[GTK_STATE_NORMAL]); - - if (xa == 3) - { - if (gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL) - xa = 2; - else - xa = 0; - } - - vw = d->width(); - vh = d->height(); - - pango_layout_set_alignment(d->layout, PANGO_ALIGN_LEFT); - gt_layout_get_extents(d->layout, &lw, &lh); - - switch (xa) - { - case 0: pango_layout_set_alignment(d->layout, PANGO_ALIGN_LEFT); break; - case 1: pango_layout_set_alignment(d->layout, PANGO_ALIGN_CENTER); break; - case 2: pango_layout_set_alignment(d->layout, PANGO_ALIGN_RIGHT); break; - } - - if (!d->markup() || !d->wrap()) - { - switch (xa) - { - case 0: vw = fw; break; - case 1: vw = (vw - lw) / 2; break; - case 2: vw = vw - lw - fw; break; - } - } - else - vw = fw; - - switch (d->lay_y) - { - case 0: vh = fw; break; - case 1: vh = (vh - lh) / 2; break; - case 2: vh = vh - lh - fw; break; - } - - if (vh < 0) vh = 0; - - vw += draw->allocation.x; - vh += draw->allocation.y; - - cairo_move_to(cr, vw, vh); - pango_cairo_show_layout(cr, d->layout); - cairo_destroy(cr); - - d->drawBorder(e); - - return false; -} -#endif - -gLabel::gLabel(gContainer *parent) : gControl(parent) -{ - textdata = NULL; - _markup = false; - _autoresize = false; - _mask_dirty = false; - _transparent = false; - _locked = false; - _wrap = false; - align = -1; - - border = widget = gtk_fixed_new(); - layout = gtk_widget_create_pango_layout(border, ""); - - realize(); - - ON_DRAW(widget, this, cb_expose, cb_draw); - - setAlignment(ALIGN_NORMAL); - setText(""); -} - -gLabel::~gLabel() -{ - if (textdata) g_free(textdata); - g_object_unref(G_OBJECT(layout)); -} - -void gLabel::updateLayout() -{ - char *bpango; - - if (_resolved_font) - gt_set_layout_from_font(layout, _resolved_font); - - if (!textdata) - pango_layout_set_text(layout, "", 0); - else - { - if (_markup) - { - bpango = gt_html_to_pango_string(textdata, -1, false); - if (!bpango) - pango_layout_set_text(layout, "", 0); - else - { - pango_layout_set_markup(layout, bpango, -1); - g_free(bpango); - } - } - else - pango_layout_set_text(layout, textdata, -1); - } -} - -void gLabel::updateSize(bool adjust, bool noresize_width) -{ - gint w, h; - int fw; - PangoRectangle ink_rect, log_rect; - - updateLayout(); - - if (_locked || !textdata || !*textdata) - return; - - fw = getFrameWidth() + getFramePadding(); - - if (_markup && _wrap) - { - w = width() - fw * 2; - if (w < 0) - return; - w *= PANGO_SCALE; - } - else - w = -1; - - pango_layout_set_width(layout, w); - - if (!_autoresize && !adjust) - return; - - gt_layout_get_extents(layout, &w, &h); - w += fw * 2; - h += fw * 2; - - if (noresize_width && w != width()) - return; - - if ((align == ALIGN_CENTER || align == ALIGN_LEFT || align == ALIGN_NORMAL || align == ALIGN_RIGHT) && h < height()) - h = height(); - - _locked = true; - resize(w, h); - _locked = false; -} - -void gLabel::adjust() -{ - updateSize(true); -} - -void gLabel::setAutoResize(bool vl) -{ - _autoresize = vl; - updateSize(); -} - -void gLabel::afterRefresh() -{ - if (!isVisible()) - return; - - _mask_dirty = _transparent; -} - -void gLabel::setTransparent(bool vl) -{ - if (_transparent == vl) - return; - - _transparent = vl; - //gtk_widget_shape_combine_mask(border, NULL, 0, 0); - //refresh(); -} - -char *gLabel::text() -{ - return textdata; -} - -void gLabel::setText(const char *vl) -{ - //bool no_text_before = !textdata || !*textdata; - - g_free(textdata); - - if (vl) - textdata = g_strdup(vl); - else - textdata = 0; - - updateSize(); - refresh(); -} - -void gLabel::setMarkup(bool vl) -{ - if (_markup != vl) - { - _markup = vl; - updateSize(); - refresh(); - } -} - - -int gLabel::alignment() -{ - return align; -} - -void gLabel::setAlignment(int al) -{ - if (align == al) - return; - - switch (al) - { - case ALIGN_BOTTOM: lay_y=2; lay_x=1; break; - case ALIGN_BOTTOM_LEFT: lay_y=2; lay_x=0; break; - case ALIGN_BOTTOM_NORMAL: lay_y=2; lay_x=3; break; - case ALIGN_BOTTOM_RIGHT: lay_y=2; lay_x=2; break; - case ALIGN_CENTER: lay_y=1; lay_x=1; break; - case ALIGN_LEFT: lay_y=1; lay_x=0; break; - case ALIGN_NORMAL: lay_y=1; lay_x=3; break; - case ALIGN_RIGHT: lay_y=1; lay_x=2; break; - case ALIGN_TOP: lay_y=0; lay_x=1; break; - case ALIGN_TOP_LEFT: lay_y=0; lay_x=0; break; - case ALIGN_TOP_NORMAL: lay_y=0; lay_x=3; break; - case ALIGN_TOP_RIGHT: lay_y=0; lay_x=2; break; - default: return; - } - - align = al; - refresh(); -} - - -bool gLabel::resize(int w, int h) -{ - int oldw = width(); - - if (gControl::resize(w, h)) - return true; - - if (autoResize() && !_locked && markup() && oldw != width()) - updateSize(false); - - return false; -} - -void gLabel::setWrap(bool v) -{ - _wrap = v; - updateSize(true); -} - -/*gColor gLabel::getFrameColor() -{ - return realForeground(); -}*/ - -void gLabel::updateSize() -{ - updateSize(false); -} - - -void gLabel::updateBorder() -{ - gControl::updateBorder(); - updateSize(false); -} diff --git a/gb.gtk/src/glabel.h b/gb.gtk/src/glabel.h deleted file mode 100644 index 835c932f0..000000000 --- a/gb.gtk/src/glabel.h +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - - glabel.h - - (c) 2000-2017 Benoît Minisini - - 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. - -***************************************************************************/ - -#ifndef __GSIMPLELABEL_H -#define __GSIMPLELABEL_H - -#include "gcontrol.h" - -class gLabel : public gControl -{ -public: - gLabel(gContainer *parent); - ~gLabel(); - - int alignment(); - int getBorder() const { return getFrameBorder(); } - char* text(); - bool isTransparent() const { return _transparent; } - bool autoResize() const { return _autoresize; } - int padding() const { return getFramePadding(); } - bool wrap() const { return _wrap; } - bool markup() const { return _markup; } - - void setAlignment(int al); - void setBorder(int vl) { setFrameBorder(vl); } - void setText(const char *st); - void setTransparent(bool vl); - void setAutoResize(bool vl); - void setPadding(int vl) { setFramePadding(vl); } - void setWrap(bool vl); - -//"Methods" - void setMarkup(bool vl); - void adjust(); - virtual bool resize(int w, int h); - virtual void afterRefresh(); - -//"Private" - //virtual gColor getFrameColor(); - virtual void updateSize(); - virtual void updateBorder(); - void updateSize(bool adjust, bool noresize = false); - void updateLayout(); - PangoLayout *layout; - int align,lay_x,lay_y; - unsigned _markup : 1; - unsigned _autoresize : 1; - unsigned _transparent : 1; - unsigned _mask_dirty : 1; - unsigned _locked : 1; - unsigned _wrap : 1; - char *textdata; -}; - -#endif diff --git a/gb.gtk/src/gtools.cpp b/gb.gtk/src/gtools.cpp index 78e2f083f..0e64a9be7 100644 --- a/gb.gtk/src/gtools.cpp +++ b/gb.gtk/src/gtools.cpp @@ -1657,7 +1657,7 @@ void gt_add_layout_from_font(PangoLayout *layout, gFont *font, int dpi) void gt_layout_alignment(PangoLayout *layout, float w, float h, float *tw, float *th, int align, float *offX, float *offY) { int ptw, pth; - pango_layout_get_size(layout, &ptw, &pth); + gt_layout_get_extents(layout, &ptw, &pth, FALSE); *tw = (float)ptw / PANGO_SCALE; *th = (float)pth / PANGO_SCALE; @@ -2503,10 +2503,18 @@ void gt_define_style_sheet(GtkStyleProvider **provider, GString *css) #endif -void gt_layout_get_extents(PangoLayout *layout, int *w, int *h) +void gt_layout_get_extents(PangoLayout *layout, int *w, int *h, bool pixels) { PangoRectangle ink_rect, log_rect; - pango_layout_get_pixel_extents(layout, &ink_rect, &log_rect); + pango_layout_get_extents(layout, &ink_rect, &log_rect); + *w = Max(ink_rect.width, log_rect.width); *h = Max(ink_rect.height, log_rect.height); + + if (pixels) + { + *w = gt_pango_to_pixel(*w); + *h = gt_pango_to_pixel(*h); + } + } diff --git a/gb.gtk/src/gtools.h b/gb.gtk/src/gtools.h index 6e9373cae..03745d541 100644 --- a/gb.gtk/src/gtools.h +++ b/gb.gtk/src/gtools.h @@ -126,7 +126,7 @@ void gt_layout_alignment(PangoLayout *layout, float w, float h, float *tw, float // Compute the extents of a layout -void gt_layout_get_extents(PangoLayout *layout, int *w, int *h); +void gt_layout_get_extents(PangoLayout *layout, int *w, int *h, bool pixels); #if GTK_CHECK_VERSION(2, 18, 0) #else diff --git a/gb.gtk/src/main.cpp b/gb.gtk/src/main.cpp index ec78067cd..5050bf98a 100644 --- a/gb.gtk/src/main.cpp +++ b/gb.gtk/src/main.cpp @@ -53,7 +53,6 @@ #include "CPanel.h" #include "CMenu.h" #include "CWindow.h" -#include "CLabel.h" #include "CButton.h" #include "CTextBox.h" #include "CTextArea.h" @@ -219,8 +218,6 @@ GB_DESC *GB_CLASSES[] EXPORT = CWindowDesc, CWindowsDesc, CFormDesc, - CLabelDesc, - CTextLabelDesc, SliderDesc, ScrollBarDesc, CButtonDesc, diff --git a/gb.gtk3/src/CLabel.cpp b/gb.gtk3/src/CLabel.cpp deleted file mode 120000 index f83802f2b..000000000 --- a/gb.gtk3/src/CLabel.cpp +++ /dev/null @@ -1 +0,0 @@ -../../gb.gtk/src/CLabel.cpp \ No newline at end of file diff --git a/gb.gtk3/src/CLabel.h b/gb.gtk3/src/CLabel.h deleted file mode 120000 index 6cfcec711..000000000 --- a/gb.gtk3/src/CLabel.h +++ /dev/null @@ -1 +0,0 @@ -../../gb.gtk/src/CLabel.h \ No newline at end of file diff --git a/gb.gtk3/src/Makefile.am b/gb.gtk3/src/Makefile.am index bc32025be..76a77d7b8 100644 --- a/gb.gtk3/src/Makefile.am +++ b/gb.gtk3/src/Makefile.am @@ -16,7 +16,7 @@ gb_gtk3_la_SOURCES = \ gfont.cpp gpicture.cpp \ gdesktop.cpp gdialog.cpp \ gcontrol.cpp gcontainer.cpp \ - gbutton.cpp gslider.cpp glabel.cpp gsignals.cpp \ + gbutton.cpp gslider.cpp gsignals.cpp \ gcombobox.cpp gtextbox.cpp gtextarea.cpp \ gpanel.cpp gtabstrip.cpp \ gmenu.cpp gtrayicon.cpp gmainwindow.cpp \ @@ -38,7 +38,6 @@ gb_gtk3_la_SOURCES = \ CWatcher.h CWatcher.cpp \ CWidget.h CWidget.cpp CContainer.h CContainer.cpp \ CDrawingArea.h CDrawingArea.cpp \ - CLabel.h CLabel.cpp \ CSlider.h CSlider.cpp \ CButton.h CButton.cpp \ CTextBox.h CTextBox.cpp \ @@ -59,7 +58,6 @@ gb_gtk3_la_SOURCES = \ gcontrol.h \ gseparator.h \ gtrayicon.h \ - glabel.h \ gbutton.h \ gcombobox.h \ gtextbox.h \ diff --git a/gb.gtk3/src/glabel.cpp b/gb.gtk3/src/glabel.cpp deleted file mode 120000 index 499ffbf93..000000000 --- a/gb.gtk3/src/glabel.cpp +++ /dev/null @@ -1 +0,0 @@ -../../gb.gtk/src/glabel.cpp \ No newline at end of file diff --git a/gb.gtk3/src/glabel.h b/gb.gtk3/src/glabel.h deleted file mode 120000 index ffd077fd4..000000000 --- a/gb.gtk3/src/glabel.h +++ /dev/null @@ -1 +0,0 @@ -../../gb.gtk/src/glabel.h \ No newline at end of file diff --git a/gb.gtk3/src/main.cpp b/gb.gtk3/src/main.cpp index a57090499..53ea98a4e 100644 --- a/gb.gtk3/src/main.cpp +++ b/gb.gtk3/src/main.cpp @@ -53,7 +53,6 @@ #include "CPanel.h" #include "CMenu.h" #include "CWindow.h" -#include "CLabel.h" #include "CButton.h" #include "CTextBox.h" #include "CTextArea.h" @@ -231,8 +230,6 @@ GB_DESC *GB_CLASSES[] EXPORT = CWindowDesc, CWindowsDesc, CFormDesc, - CLabelDesc, - CTextLabelDesc, SliderDesc, ScrollBarDesc, CButtonDesc, diff --git a/gb.qt4/src/CContainer.cpp b/gb.qt4/src/CContainer.cpp index 0e6b11329..3a11af462 100755 --- a/gb.qt4/src/CContainer.cpp +++ b/gb.qt4/src/CContainer.cpp @@ -585,6 +585,8 @@ static void _draw_border(QPainter *p, int frame, QWidget *w, QStyleOptionFrame & else style = QApplication::style(); + p->save(); + switch (frame) { case BORDER_PLAIN: @@ -628,10 +630,9 @@ static void _draw_border(QPainter *p, int frame, QWidget *w, QStyleOptionFrame & optv3.frameShape = QFrame::StyledPanel; style->drawPrimitive(QStyle::PE_FrameGroupBox, &optv3, p, w); break; - - default: - return; } + + p->restore(); } void CCONTAINER_draw_border(QPainter *p, char frame, QWidget *wid) @@ -821,6 +822,25 @@ void MyContainer::paintEvent(QPaintEvent *event) PAINT_end(); } +void MyContainer::changeEvent(QEvent *e) +{ + void *_object = CWidget::get(this); + + if (!THIS_ARRANGEMENT->paint) + { + MyFrame::changeEvent(e); + return; + } + + if (e->type() == QEvent::FontChange) + { + GB_FUNCTION func; + if (!GB.GetFunction(&func, THIS, "UserControl_Font", NULL, NULL)) + GB.Call(&func, 0, TRUE); + else + GB.Error(NULL); + } +} /*void MyContainer::childEvent(QChildEvent *e) diff --git a/gb.qt4/src/CContainer.h b/gb.qt4/src/CContainer.h index b4887bb5f..65ab9a343 100644 --- a/gb.qt4/src/CContainer.h +++ b/gb.qt4/src/CContainer.h @@ -200,6 +200,7 @@ protected: virtual void showEvent(QShowEvent *); virtual void hideEvent(QHideEvent *); virtual void paintEvent(QPaintEvent *); + virtual void changeEvent(QEvent *); }; #endif diff --git a/gb.qt4/src/CLabel.cpp b/gb.qt4/src/CLabel.cpp deleted file mode 100644 index a2712594a..000000000 --- a/gb.qt4/src/CLabel.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/*************************************************************************** - - CLabel.cpp - - (c) 2000-2017 Benoît Minisini - - 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 __CLABEL_CPP - -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include - -#include "gambas.h" - -#include "CConst.h" -#include "CColor.h" -#include "CLabel.h" - -/*#define DEBUG_CBUTTON*/ - - -/***************************************************************************/ - -BEGIN_METHOD(Label_new, GB_OBJECT parent) - - QLabel *wid = new MyLabel(QCONTAINER(VARG(parent))); - - wid->setTextFormat(Qt::PlainText); - wid->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); // + Qt::WordBreak); - //THIS->widget.flag.fillBackground = TRUE; - - CWIDGET_new(wid, (void *)_object); - -END_METHOD - - -BEGIN_METHOD(TextLabel_new, GB_OBJECT parent) - - MyLabel *wid = new MyLabel(QCONTAINER(VARG(parent))); - - wid->setTextFormat(Qt::RichText); - wid->setAlignment(Qt::AlignLeft | Qt::AlignTop); - wid->setWordWrap(true); - //THIS->widget.flag.fillBackground = TRUE; - - CWIDGET_new(wid, (void *)_object); - -END_METHOD - - -BEGIN_PROPERTY(Label_Text) - - if (READ_PROPERTY) - RETURN_NEW_STRING(WIDGET->text()); - else - WIDGET->setText(QSTRING_PROP()); - -END_PROPERTY - - -BEGIN_PROPERTY(Label_Alignment) - - if (READ_PROPERTY) - GB.ReturnInteger(CCONST_alignment(WIDGET->alignment() & ALIGN_MASK, ALIGN_NORMAL, false)); - else - WIDGET->setAlignment((Qt::Alignment)CCONST_alignment(VPROP(GB_INTEGER), ALIGN_NORMAL, true)); - -END_PROPERTY - - -BEGIN_PROPERTY(Label_AutoResize) - - if (READ_PROPERTY) - GB.ReturnInteger(WIDGET->getAutoResize()); - else - WIDGET->setAutoResize(VPROP(GB_BOOLEAN)); - -END_PROPERTY - -BEGIN_PROPERTY(Label_Padding) - - if (READ_PROPERTY) - GB.ReturnInteger(WIDGET->margin()); - else - { - WIDGET->setMargin(VPROP(GB_INTEGER)); - WIDGET->calcMinimumHeight(); - WIDGET->update(); - } - -END_PROPERTY - - -BEGIN_PROPERTY(TextLabel_Alignment) - - if (READ_PROPERTY) - GB.ReturnInteger(CCONST_alignment(WIDGET->alignment() & ALIGN_MASK, ALIGN_NORMAL, false)); - else - WIDGET->setAlignment((Qt::Alignment)CCONST_alignment(VPROP(GB_INTEGER), ALIGN_NORMAL, true)); - -END_PROPERTY - - -BEGIN_METHOD_VOID(Label_Adjust) - - WIDGET->adjust(); - -END_METHOD - -BEGIN_PROPERTY(Label_Transparent) - - if (READ_PROPERTY) - GB.ReturnBoolean(THIS->transparent); - else - THIS->transparent = VPROP(GB_BOOLEAN); - -END_PROPERTY - -BEGIN_PROPERTY(Label_Wrap) - - if (READ_PROPERTY) - GB.ReturnBoolean(WIDGET->wordWrap()); - else - WIDGET->setWordWrap(VPROP(GB_BOOLEAN)); - -END_PROPERTY - -BEGIN_PROPERTY(Label_Border) - - if (READ_PROPERTY) - GB.ReturnInteger(WIDGET->border()); - else - { - WIDGET->setBorder(VPROP(GB_INTEGER)); - WIDGET->calcMinimumHeight(); - } - -END_PROPERTY - -//--------------------------------------------------------------------------- - -GB_DESC CLabelDesc[] = -{ - GB_DECLARE("Label", sizeof(CLABEL)), GB_INHERITS("Control"), - - GB_METHOD("_new", NULL, Label_new, "(Parent)Container;"), - - GB_PROPERTY("Text", "s", Label_Text), - GB_PROPERTY("Caption", "s", Label_Text), - GB_PROPERTY("Alignment", "i", Label_Alignment), - GB_PROPERTY("Border", "i", Label_Border), - GB_PROPERTY("AutoResize", "b", Label_AutoResize), - GB_PROPERTY("Padding", "i", Label_Padding), - GB_PROPERTY("Transparent", "b", Label_Transparent), - GB_METHOD("Adjust", NULL, Label_Adjust, NULL), - - LABEL_DESCRIPTION, - - GB_END_DECLARE -}; - - -GB_DESC CTextLabelDesc[] = -{ - GB_DECLARE("TextLabel", sizeof(CLABEL)), GB_INHERITS("Control"), - - GB_METHOD("_new", NULL, TextLabel_new, "(Parent)Container;"), - - GB_PROPERTY("Text", "s", Label_Text), - GB_PROPERTY("Caption", "s", Label_Text), - GB_PROPERTY("Alignment", "i", TextLabel_Alignment), - GB_PROPERTY("Border", "i", Label_Border), - GB_PROPERTY("AutoResize", "b", Label_AutoResize), - GB_PROPERTY("Padding", "i", Label_Padding), - GB_PROPERTY("Transparent", "b", Label_Transparent), - GB_PROPERTY("Wrap", "b", Label_Wrap), - GB_METHOD("Adjust", NULL, Label_Adjust, NULL), - - TEXTLABEL_DESCRIPTION, - - GB_END_DECLARE -}; - - -/** MyLabel *****************************************************************/ - -MyLabel::MyLabel(QWidget *parent) : QLabel(parent) -{ - autoResize = false; - locked = false; - _border = BORDER_NONE; - setIndent(0); - calcMinimumHeight(); -} - - -void MyLabel::changeEvent(QEvent *e) -{ - QLabel::changeEvent(e); - if (e->type() == QEvent::FontChange || e->type() == QEvent::StyleChange) - calcMinimumHeight(); -} - -void MyLabel::setText(const QString &text) -{ - QLabel::setText(text); - calcMinimumHeight(); - //qDebug("%s: %d", text.latin1(), isVisible()); -} - -void MyLabel::calcMinimumHeight(bool adjust) -{ - void *_object = CWidget::getReal(this); - - if (!THIS || (!autoResize && !adjust) || CWIDGET_is_design(THIS) || text().length() <= 0) - return; - - //qDebug("calcMinimumHeight: %p %s", ob, ((CWIDGET *)ob)->name); - - int w, h, nw, nh; - int f = contentsMargins().left() + margin(); - QRect br; - - if (textFormat() == Qt::RichText) - { - QTextDocument doc; - - doc.setDefaultFont(font()); - doc.setDocumentMargin(0); - doc.setHtml(text()); - - if (wordWrap()) - { - w = width() - f * 2; - doc.setTextWidth(w); - - if (adjust) - { - nw = doc.idealWidth(); - doc.setTextWidth(nw); - nh = doc.size().height(); - nw = doc.size().width(); - - } - else - { - nh = doc.size().height(); - nw = w; - } - } - else - { - nh = doc.size().height(); - nw = doc.size().width(); - } - - //nw += 2; // Why? Don't know... - //nh += 2; - } - else - { - QFontMetrics fm = fontMetrics(); - br = fm.boundingRect(0, 0, QWIDGETSIZE_MAX, QWIDGETSIZE_MAX, alignment(), text()); - nw = br.width(); - nh = br.height(); - } - - w = nw + f * 2; - h = nh + f * 2; - - int a = CCONST_alignment(WIDGET->alignment() & ALIGN_MASK, ALIGN_NORMAL, false); - if ((a == ALIGN_CENTER || a == ALIGN_LEFT || a == ALIGN_NORMAL || a == ALIGN_RIGHT) && nh < height()) - nh = height(); - - locked = true; - CWIDGET_resize(THIS, w, h); - locked = false; -} - -#if 0 -void MyLabel::calcMinimumHeight(bool adjust) -{ - void *ob = CWidget::get(this); - int w, h, nw, nh; - - if (!adjust && (!autoResize || CWIDGET_test_flag(ob, WF_DESIGN) || text().length() <= 0)) - { - setMinimumSize(0, 0); - setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); - } - else - { - int f = frameWidth(); - QRect br; - - if (f > 0 && f < 4) - f = 4; - - if (textFormat() == Qt::RichText) - { - QTextDocument doc; - - doc.setHtml(text()); - doc.setDefaultFont(font()); - - w = width() - f * 2; - - doc.setTextWidth(w); - nh = doc.size().height(); - nw = adjust ? doc.idealWidth() : w; - } - else - { - QFontMetrics fm = fontMetrics(); - br = fm.boundingRect(0, 0, QWIDGETSIZE_MAX, QWIDGETSIZE_MAX, alignment(), text()); - nw = br.width(); - nh = br.height(); - if (alignment() & Qt::AlignVCenter && (nh + f * 2) < height()) - nh = height() - f * 2; - } - - w = nw + f * 2; - h = nh + f * 2; - - - //setMinimumSize(w, h); - //setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); - - //if (textFormat() != Qt::RichText && h < height()) - // h = height(); - if (!noresize) - { - locked = true; - //qDebug("%p: resize(%d, %d)", this, w, h); - resize(w, h); - locked = false; - } - } -} -#endif - -void MyLabel::resizeEvent(QResizeEvent *e) -{ - QLabel::resizeEvent(e); - - if (autoResize && !locked && textFormat() == Qt::RichText && e->oldSize().width() != e->size().width()) - calcMinimumHeight(); -} - -void MyLabel::adjust() -{ - calcMinimumHeight(true); -} - -void MyLabel::paintEvent(QPaintEvent *e) -{ - QPainter p(this); - CCONTAINER_draw_border(&p, _border, this); - QLabel::paintEvent(e); -} - diff --git a/gb.qt4/src/CLabel.h b/gb.qt4/src/CLabel.h deleted file mode 100644 index 5b83f16e3..000000000 --- a/gb.qt4/src/CLabel.h +++ /dev/null @@ -1,93 +0,0 @@ -/*************************************************************************** - - CLabel.h - - (c) 2000-2017 Benoît Minisini - - 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. - -***************************************************************************/ - -#ifndef __CLABEL_H -#define __CLABEL_H - -#include -#include -#include -#include - -#include "gambas.h" - -#include "CWidget.h" -#include "CPicture.h" -#include "CContainer.h" - -#ifndef __CLABEL_CPP -extern GB_DESC CLabelDesc[]; -extern GB_DESC CTextLabelDesc[]; -extern GB_DESC CSeparatorDesc[]; -#else - -#define QLABEL(object) ((QLabel *)((CWIDGET *)object)->widget) - -#define THIS ((CLABEL *)_object) -#define WIDGET ((MyLabel *)((CWIDGET *)_object)->widget) -#define SEPARATOR ((MySeparator *)((CWIDGET *)_object)->widget) - -#endif - -typedef - struct { - CWIDGET widget; - bool transparent; - } - CLABEL; - -typedef - struct { - CWIDGET widget; - } - CSEPARATOR; - -class MyLabel : public QLabel -{ - Q_OBJECT - -public: - - MyLabel(QWidget *parent); - void calcMinimumHeight(bool adjust = false); - bool getAutoResize() { return autoResize; } - void setAutoResize(bool a) { autoResize = a; calcMinimumHeight(); } - virtual void setText(const QString &); - void adjust(); - int border() const { return _border; } - void setBorder(int border) { CCONTAINER_set_border(&_border, border, this); } - -protected: - - virtual void changeEvent(QEvent *); - virtual void resizeEvent(QResizeEvent *); - virtual void paintEvent(QPaintEvent *); - -private: - - unsigned autoResize : 1; - unsigned locked : 1; - char _border; -}; - -#endif diff --git a/gb.qt4/src/cpaint_impl.cpp b/gb.qt4/src/cpaint_impl.cpp index 929ba9dfc..4bd7afbf6 100644 --- a/gb.qt4/src/cpaint_impl.cpp +++ b/gb.qt4/src/cpaint_impl.cpp @@ -396,6 +396,17 @@ static void Antialias(GB_PAINT *d, int set, int *antialias) *antialias = PAINTER(d)->testRenderHint(QPainter::Antialiasing) ? 1 : 0; } +static void set_painter_font(QPainter *p, QFont f) +{ + p->setFont(f); + // Strange bug of QT. Sometimes the font does not apply (cf. DrawTextShadow) + if (f != p->font()) + { + f.fromString(f.toString()); + p->setFont(f); + } +} + static void apply_font(QFont &font, void *object = 0) { GB_PAINT *d = (GB_PAINT *)DRAW.Paint.GetCurrent(); @@ -404,13 +415,7 @@ static void apply_font(QFont &font, void *object = 0) if (d->fontScale != 1) f.setPointSizeF(f.pointSizeF() * d->fontScale); - PAINTER(d)->setFont(f); - // Strange bug of QT. Sometimes the font does not apply (cf. DrawTextShadow) - if (f != PAINTER(d)->font()) - { - f.fromString(f.toString()); - PAINTER(d)->setFont(f); - } + set_painter_font(PAINTER(d), f); } static void Font(GB_PAINT *d, int set, GB_FONT *font) @@ -1006,7 +1011,7 @@ static void draw_text(GB_PAINT *d, bool rich, const char *text, int len, float w MyPaintDevice device; QPainter p(&device); - p.setFont(PAINTER(d)->font()); + set_painter_font(&p, PAINTER(d)->font()); p.setPen(PAINTER(d)->pen()); p.setBrush(PAINTER(d)->brush()); @@ -1035,8 +1040,10 @@ static void get_text_extents(GB_PAINT *d, bool rich, const char *text, int len, QPainterPath path; MyPaintDevice device; QPainter p(&device); + QFont f = PAINTER(d)->font(); - p.setFont(PAINTER(d)->font()); + set_painter_font(&p, f); + _draw_path = &path; GetCurrentPoint(d, &_draw_x, &_draw_y); _draw_y -= PAINTER(d)->fontMetrics().ascent(); diff --git a/gb.qt4/src/main.cpp b/gb.qt4/src/main.cpp index 1f0dc3b35..4609d69ba 100644 --- a/gb.qt4/src/main.cpp +++ b/gb.qt4/src/main.cpp @@ -64,7 +64,6 @@ #include "CWindow.h" #include "CButton.h" #include "CContainer.h" -#include "CLabel.h" #include "CTextBox.h" #include "CTextArea.h" #include "CMenu.h" @@ -1350,7 +1349,6 @@ GB_DESC *GB_CLASSES[] EXPORT = CControlDesc, ContainerChildrenDesc, ContainerDesc, UserControlDesc, UserContainerDesc, CMenuChildrenDesc, CMenuDesc, - CLabelDesc, CTextLabelDesc, CButtonDesc, CToggleButtonDesc, CToolButtonDesc, CCheckBoxDesc, CRadioButtonDesc, CTextBoxSelectionDesc, CTextBoxDesc, CComboBoxItemDesc, CComboBoxDesc, diff --git a/gb.qt5/src/CLabel.cpp b/gb.qt5/src/CLabel.cpp deleted file mode 120000 index 36ce1627c..000000000 --- a/gb.qt5/src/CLabel.cpp +++ /dev/null @@ -1 +0,0 @@ -../../gb.qt4/src/CLabel.cpp \ No newline at end of file diff --git a/gb.qt5/src/CLabel.h b/gb.qt5/src/CLabel.h deleted file mode 120000 index 5812f6294..000000000 --- a/gb.qt5/src/CLabel.h +++ /dev/null @@ -1 +0,0 @@ -../../gb.qt4/src/CLabel.h \ No newline at end of file diff --git a/gb.qt5/src/Makefile.am b/gb.qt5/src/Makefile.am index 5c8e57f31..a9b6f6814 100644 --- a/gb.qt5/src/Makefile.am +++ b/gb.qt5/src/Makefile.am @@ -21,7 +21,6 @@ gb_qt5_la_SOURCES = \ CWindow.h CWindow_moc.cpp CWindow.cpp \ CButton.h CButton_moc.cpp CButton.cpp \ CContainer.h CContainer_moc.cpp CContainer.cpp \ - CLabel.h CLabel_moc.cpp CLabel.cpp \ CTextBox.h CTextBox_moc.cpp CTextBox.cpp \ CMenu.h CMenu_moc.cpp CMenu.cpp \ CMouse.h CMouse_moc.cpp CMouse.cpp \ diff --git a/gb.qt5/src/main.cpp b/gb.qt5/src/main.cpp index 7a7d63299..5c3ea0a7f 100644 --- a/gb.qt5/src/main.cpp +++ b/gb.qt5/src/main.cpp @@ -63,7 +63,6 @@ #include "CWindow.h" #include "CButton.h" #include "CContainer.h" -#include "CLabel.h" #include "CTextBox.h" #include "CTextArea.h" #include "CMenu.h" @@ -1107,7 +1106,6 @@ GB_DESC *GB_CLASSES[] EXPORT = CControlDesc, ContainerChildrenDesc, ContainerDesc, UserControlDesc, UserContainerDesc, CMenuChildrenDesc, CMenuDesc, - CLabelDesc, CTextLabelDesc, CButtonDesc, CToggleButtonDesc, CToolButtonDesc, CCheckBoxDesc, CRadioButtonDesc, CTextBoxSelectionDesc, CTextBoxDesc, CComboBoxItemDesc, CComboBoxDesc,