[GB.FORM]

* BUG: Fix ToolPanel Index value when decreasing the Count property.
* NEW: Less space around GridView row headers text.

[GB.QT4]
* BUG: Do not crash when UserControl or UserContainer container is deleted.
* BUG: Delete the Qt4 application class in component exit routine, 
  otherwise Qt 4.8 seems to crash sometimes.


git-svn-id: svn://localhost/gambas/trunk@4521 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-03-02 01:21:33 +00:00
parent e23fbfe985
commit 1735a652a2
7 changed files with 52 additions and 8 deletions

View File

@ -241,7 +241,7 @@ Public Sub _SetRowText(iRow As Integer, sText As String)
If Not $cText Then $cText = New Collection
$cText[iRow] = sText
If sText Then
W = GetView().Font.TextWidth(sText) + 16
W = GetView().Font.TextWidth(sText) + 8
If W > Width_Read() Then $iWidth = W
Endif

View File

@ -63,6 +63,7 @@ Private Sub Count_Write(iCount As Integer)
Next
$aToolBar.Remove(iCount, -1)
Index_Write(Min($iCurrent, iCount - 1))
Else

View File

@ -325,9 +325,9 @@ static void show_frame(CWIDGET *control, int x, int y, int w, int h)
int i;
if (GB.Is(control, CLASS_Container))
wid = QCONTAINER(control);
else
wid = QWIDGET(control);
wid = QCONTAINER(control);
else
wid = QWIDGET(control);
if (w <= 0 || h <= 0)
{

View File

@ -1108,10 +1108,12 @@ END_METHOD
BEGIN_PROPERTY(UserControl_Container)
CCONTAINER *current = (CCONTAINER *)CWidget::get(CONTAINER);
void *current = (CCONTAINER *)CWidget::get(CONTAINER);
if (READ_PROPERTY)
{
GB.ReturnObject(current);
}
else
{
CCONTAINER *cont = (CCONTAINER *)VPROP(GB_OBJECT);
@ -1119,9 +1121,11 @@ BEGIN_PROPERTY(UserControl_Container)
QWidget *p;
// sanity checks
if (!cont)
{
if (current)
CWIDGET_container_for(current, NULL);
THIS->container = WIDGET;
CWIDGET_register_proxy(THIS, NULL);
return;
@ -1144,6 +1148,10 @@ BEGIN_PROPERTY(UserControl_Container)
GB.Error("Container must be a child control");
else
{
if (current)
CWIDGET_container_for(current, NULL);
CWIDGET_container_for(cont, THIS);
THIS->container = w;
CWIDGET_update_design((CWIDGET *)THIS);

View File

@ -290,6 +290,34 @@ void CWIDGET_init_name(CWIDGET *_object)
set_name(THIS, name);
}
bool CWIDGET_container_for(void *_object, void *container_for)
{
if (THIS_EXT)
{
if (container_for)
{
if (!THIS_EXT->container_for)
{
THIS_EXT->container_for = container_for;
return false;
}
}
else
{
THIS_EXT->container_for = NULL;
return false;
}
}
else
{
if (container_for)
ENSURE_EXT(THIS)->container_for = container_for;
return false;
}
return true;
}
void CWIDGET_new(QWidget *w, void *_object, bool no_show, bool no_filter, bool no_init)
{
//QAbstractScrollArea *sa;
@ -2084,6 +2112,12 @@ void CWidget::destroy()
EXT(THIS_EXT->proxy)->proxy_for = NULL;
if (THIS_EXT->proxy_for)
EXT(THIS_EXT->proxy_for)->proxy = NULL;
if (THIS_EXT->container_for)
{
((CCONTAINER *)THIS_EXT->container_for)->container = ((CWIDGET *)THIS_EXT->container_for)->widget;
THIS_EXT->container_for = NULL;
}
GB.Unref(POINTER(&THIS_EXT->cursor));
GB.FreeString(&THIS_EXT->popup);

View File

@ -45,6 +45,7 @@ typedef
void *proxy_for;
char *action;
int focusPolicy;
void *container_for;
}
CWIDGET_EXT;
@ -200,7 +201,7 @@ void CWIDGET_resize_cached(void *_object, int w, int h);
void CWIDGET_move_resize_cached(void *_object, int x, int y, int w, int h);
void CWIDGET_handle_focus(CWIDGET *control, bool on);
void CWIDGET_register_proxy(void *_object, void *proxy);
bool CWIDGET_container_for(void *_object, void *container_for);
void CACTION_register(void *control, const char *old, const char *key);
void CACTION_raise(void *control);

View File

@ -1136,7 +1136,7 @@ void EXPORT GB_EXIT()
X11_exit();
#endif
//qApp->setStyle("windows");
//delete qApp;
delete qApp;
}
#ifndef NO_X_WINDOW