[CONFIGURATION]

* BUG: Fix the component template script.

[GB.FORM]
* BUG: SidePanel controls now behave correctly when they are put inside a 
  TabStrip.

[GB.GMP]
* NEW: Skeleton for a new component based on the GNU "big numbers" GMP 
  library.

[GB.GTK]
* NEW: TabStrip.FindIndex() is a new method that returns the index of 
  parent tab of a specific child.
* BUG: Fix Control.Raise() and Control.Lower() method when the parent is a
  TabStrip.

[GB.QT4]
* NEW: TabStrip.FindIndex() is a new method that returns the index of 
  parent tab of a specific child.

[GB.QT4.EXT]
* NEW: Editor: The current line is now visible when using a dark highlight 
  theme.


git-svn-id: svn://localhost/gambas/trunk@5016 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-08-07 14:04:55 +00:00
parent b995e09e22
commit f457c9608c
36 changed files with 289 additions and 102 deletions

View file

@ -1,22 +1,22 @@
/* Copyrights */
#define __COPYRIGHT (c) 2007
#define __COPYRIGHT (c) 2012
#define __AUTHOR Benoît Minisini
#define __EMAIL <gambas@users.sourceforge.net>
/* Name of the component */
#define __COMPONENT gb.gui
#define __COMPONENT gb.gmp
/* Name of the component with points replaced by underscore */
#define __COMPONENT_UNDERSCORE gb_gui
#define __COMPONENT_UNDERSCORE gb_gmp
/* Short name of the component */
#define __NAME gui
#define __NAME gmp
/* Short name of the component in uppercase */
#define __UNAME GUI
#define __UNAME GMP
/* Description of the component */
#define __DESCRIPTION QT/GTK+ GUI switcher component
#define __DESCRIPTION GNU multi-precision arithmetic library component
/* If the component detection uses pkg-config */
#define __USE_PKGCONFIG 0
@ -24,10 +24,10 @@
#if __USE_PKGCONFIG
/* Name of the package for pkg-config */
#define __PKGCONFIG_NAME test-1.0
#define __PKGCONFIG_NAME gsl
/* Minimum version needed */
#define __PKGCONFIG_VERSION 1.2.8
#define __PKGCONFIG_VERSION
#else /* __USE_PKGCONFIG */
@ -44,30 +44,33 @@
#define __USE_XWINDOW 0
/* Includes to search for */
#define __SEARCH_INCLUDE
#define __SEARCH_INCLUDE gmp.h
/* Includes directories search path */
#define __SEARCH_INCLUDE_PATH
#define __SEARCH_INCLUDE_PATH /usr/local /usr
/* Includes sub-directories search */
#define __SEARCH_INCLUDE_DIR
#define __SEARCH_INCLUDE_DIR include
/* Libraries to search for */
#define __SEARCH_LIBRARY
#define __SEARCH_LIBRARY libgmp.$SHLIBEXT
/* Libraries directories search path */
#define __SEARCH_LIBRARY_PATH
#define __SEARCH_LIBRARY_PATH /usr/local /usr
/* Libraries sub-directories search path */
#define __SEARCH_LIBRARY_DIR
#define __SEARCH_LIBRARY_DIR lib/* lib
/* Libraries to link with */
#define __LIBRARY
#define __LIBRARY -lgmp
/* Includes to link with */
#define __INCLUDE
#endif /* __USE_PKGCONFIG */
/* Source file list */
#define __SOURCES main.c main.h test.c test.h
#define __SOURCES main.c main.h
/* Main C/C++ source basename in uppercase */
#define __MAIN_UNAME MAIN

View file

@ -18,7 +18,7 @@ GB_FIND_QT_MOC
GB_COMPONENT_PKG_CONFIG(
__NAME,
__UNAME,
[__DESCRIPTION],
__COMPONENT,
[src],
__PKGCONFIG_NAME)
@ -45,7 +45,7 @@ GB_COMPONENT_PKG_CONFIG(
GB_COMPONENT(
__NAME,
__UNAME,
[__DESCRIPTION],
__COMPONENT,
[src],
#ifdef __SEARCH_INCLUDE
[GB_FIND(__SEARCH_INCLUDE, __SEARCH_INCLUDE_PATH, __SEARCH_INCLUDE_DIR)],

1
TODO
View file

@ -43,7 +43,6 @@ DEVELOPMENT ENVIRONMENT
- An option to interpret "." and "," when reading float in a CSV import.
- Class template files.
- Redesign the source code navigator (F2 and SHIFT+F2).
- TODO / FIXME keywords in a tab.
GUI RELATED STUFF

View file

@ -95,7 +95,7 @@ msgid "OK"
msgstr ""
#: FDirChooser.form:168 FEditBookmark.class:109 FInputBox.form:49
#: FSidePanel.class:931 FWizard.form:54
#: FSidePanel.class:945 FWizard.form:54
msgid "Cancel"
msgstr ""
@ -255,11 +255,11 @@ msgstr ""
msgid "Do not display this message again"
msgstr ""
#: FSidePanel.class:921
#: FSidePanel.class:935
msgid "Hidden"
msgstr ""
#: FSidePanel.class:925 Form1.form:21
#: FSidePanel.class:939 Form1.form:21
msgid "Transparent"
msgstr ""

View file

@ -15,11 +15,10 @@ Translate=1
Language=en
Type=Component
Maintainer=David Villalobos Cambronero
Vendor=Princeton
Address=david_villalobos_c@yahoo.com
License=General Public Licence
Prefix=1
PackageName=gambas3-princeton-gb-form-2.99
PackageName=gambas3-gb-form-3.2.90
Packager=1
Systems=autotools,debian
Systems=debian
Groups=debian:"embedded"

View file

@ -336,6 +336,9 @@ End
Private Sub RefreshAll()
Dim D As Integer
Dim hParent As Container
Dim hTabStrip As TabStrip
Dim iIndex As Integer
If Not $bOpened Then Return
@ -358,7 +361,18 @@ Private Sub RefreshAll()
If Not $hShowPanel Then
$hShowPanel = New Panel(Me.Parent.Parent) As "panMove"
hParent = Me.Parent.Parent
If hParent Is TabStrip Then
hTabStrip = hParent
iIndex = hTabStrip.Index
hTabStrip.Index = hTabStrip.FindIndex(Me.Parent)
Endif
$hShowPanel = New Panel(hParent) As "panMove"
If hTabStrip Then hTabStrip.Index = iIndex
$hShowPanel.Ignore = True
$hShowPanel.Mouse = Mouse.Pointing
$hShowButtonLeft = CreateShowButton()

View file

@ -24,10 +24,11 @@ SearchComment=False
SearchString=True
[OpenFile]
Active=1
File[1]=".src/Desktop.class:203.0"
File[1]=".src/Desktop.class:29.2"
File[2]=".src/_Desktop_Passwords.class:26.24"
Count=2
Active=3
File[3]="xdg-utils/xdg-email:44.8"
Count=3
[Watches]
Count=0

0
gb.gmp/AUTHORS Normal file
View file

1
gb.gmp/COPYING Symbolic link
View file

@ -0,0 +1 @@
../COPYING

0
gb.gmp/ChangeLog Normal file
View file

1
gb.gmp/INSTALL Symbolic link
View file

@ -0,0 +1 @@
../INSTALL

3
gb.gmp/Makefile.am Normal file
View file

@ -0,0 +1,3 @@
ACLOCAL_AMFLAGS = -I m4 --install
SUBDIRS = @GMP_DIR@
EXTRA_DIST = reconf gambas.h gb*.h

0
gb.gmp/NEWS Normal file
View file

0
gb.gmp/README Normal file
View file

1
gb.gmp/acinclude.m4 Symbolic link
View file

@ -0,0 +1 @@
../acinclude.m4

1
gb.gmp/component.am Symbolic link
View file

@ -0,0 +1 @@
../component.am

17
gb.gmp/configure.ac Normal file
View file

@ -0,0 +1,17 @@
dnl ---- configure.ac for gb.gmp
AC_INIT(configure.ac)
AC_CONFIG_MACRO_DIR([m4])
GB_INIT(gb.gmp)
AC_PROG_LIBTOOL
GB_COMPONENT(
gmp,
GMP,
gb.gmp,
[src],
[GB_FIND(gmp.h, /usr/local /usr, include)],
[GB_FIND(libgmp.$SHLIBEXT, /usr/local /usr, lib)],
[$C_LIB -lgmp],
[ ])
AC_OUTPUT( Makefile src/Makefile )
GB_PRINT_MESSAGES

1
gb.gmp/gambas.h Symbolic link
View file

@ -0,0 +1 @@
../main/share/gambas.h

1
gb.gmp/gb_common.h Symbolic link
View file

@ -0,0 +1 @@
../main/share/gb_common.h

1
gb.gmp/m4 Symbolic link
View file

@ -0,0 +1 @@
../m4

1
gb.gmp/missing Symbolic link
View file

@ -0,0 +1 @@
../missing

1
gb.gmp/reconf Symbolic link
View file

@ -0,0 +1 @@
../reconf

10
gb.gmp/src/Makefile.am Normal file
View file

@ -0,0 +1,10 @@
COMPONENT = gb.gmp
include $(top_srcdir)/component.am
gblib_LTLIBRARIES = gb.gmp.la
gb_gmp_la_LIBADD = @GMP_LIB@
gb_gmp_la_LDFLAGS = -module @LD_FLAGS@ @GMP_LDFLAGS@
gb_gmp_la_CPPFLAGS = @GMP_INC@
gb_gmp_la_SOURCES = main.c main.h

View file

@ -0,0 +1,3 @@
[Component]
Author=
Alpha=1

28
gb.gmp/src/main.c Normal file
View file

@ -0,0 +1,28 @@
/***************************************************************************
main.c
gb.gmp component
(c) 2012 Benoît Minisini <gambas@users.sourceforge.net>
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 1, 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 __MAIN_C
#include "main.h"

35
gb.gmp/src/main.h Normal file
View file

@ -0,0 +1,35 @@
/***************************************************************************
main.h
gb.gmp component
(c) 2012 Benoît Minisini <gambas@users.sourceforge.net>
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 1, 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 __MAIN_H
#define __MAIN_H
#include "gambas.h"
#ifndef __MAIN_C
extern GB_INTERFACE GB;
#endif
#endif /* __MAIN_H */

View file

@ -302,6 +302,17 @@ BEGIN_PROPERTY(CTAB_visible)
END_PROPERTY
BEGIN_METHOD(TabStrip_FindIndex, GB_OBJECT child)
CWIDGET *child = (CWIDGET *)VARG(child);
if (GB.CheckObject(child))
return;
GB.ReturnInteger(TABSTRIP->findIndex(child->widget));
END_METHOD
/***************************************************************************
@ -309,9 +320,9 @@ END_PROPERTY
***************************************************************************/
GB_DESC CTabChildrenDesc[] =
GB_DESC CTabStripContainerChildrenDesc[] =
{
GB_DECLARE(".Tab.Children", 0), GB_VIRTUAL_CLASS(),
GB_DECLARE_VIRTUAL(".TabStripContainer.Children"),
GB_METHOD("_next", "Control", CTAB_next, NULL),
GB_PROPERTY_READ("Count", "i", CTAB_count),
@ -321,16 +332,16 @@ GB_DESC CTabChildrenDesc[] =
};
GB_DESC CTabDesc[] =
GB_DESC CTabStripContainerDesc[] =
{
GB_DECLARE(".Tab", 0), GB_VIRTUAL_CLASS(),
GB_DECLARE_VIRTUAL(".TabStripContainer"),
GB_PROPERTY("Text", "s", CTAB_text),
GB_PROPERTY("Picture", "Picture", CTAB_picture),
GB_PROPERTY("Caption", "s", CTAB_text),
GB_PROPERTY("Enabled", "b", CTAB_enabled),
GB_PROPERTY("Visible", "b", CTAB_visible),
GB_PROPERTY_SELF("Children", ".Tab.Children"),
GB_PROPERTY_SELF("Children", ".TabStripContainer.Children"),
GB_METHOD("Delete", 0, CTAB_delete, 0),
GB_END_DECLARE
@ -350,7 +361,7 @@ GB_DESC CTabStripDesc[] =
GB_PROPERTY("Picture", "Picture", CTABSTRIP_picture),
GB_PROPERTY("Closable", "b", TabStrip_Closable),
GB_PROPERTY("Caption", "s", CTABSTRIP_text),
GB_PROPERTY_READ("Current", ".Tab", CTABSTRIP_current),
GB_PROPERTY_READ("Current", ".TabStripContainer", CTABSTRIP_current),
GB_PROPERTY("Index", "i", CTABSTRIP_index),
GB_PROPERTY("Orientation", "i", CTABSTRIP_orientation),
@ -362,7 +373,8 @@ GB_DESC CTabStripDesc[] =
GB_PROPERTY("Indent", "b", CCONTAINER_indent),
GB_PROPERTY("Invert", "b", Container_Invert),
GB_METHOD("_get", ".Tab", CTABSTRIP_get, "(Index)i"),
GB_METHOD("_get", ".TabStripContainer", CTABSTRIP_get, "(Index)i"),
GB_METHOD("FindIndex", "i", TabStrip_FindIndex, "(Child)Control;"),
GB_EVENT("Click", NULL, NULL, &EVENT_Click),
GB_EVENT("Close", NULL, "(Index)i", &EVENT_Close),

View file

@ -31,8 +31,8 @@
#ifndef __CTABSTRIP_CPP
extern GB_DESC CTabStripDesc[];
extern GB_DESC CTabDesc[];
extern GB_DESC CTabChildrenDesc[];
extern GB_DESC CTabStripContainerDesc[];
extern GB_DESC CTabStripContainerChildrenDesc[];
#else

View file

@ -969,8 +969,9 @@ void gControl::lower()
gpointer *p;
GList *chd;
GtkWidget *child;
gControl *Br;
gControl *br;
int x,y;
GtkContainer *parent;
if (!pr) return;
if (pr->getClass()==Type_gSplitter) return;
@ -993,17 +994,23 @@ void gControl::lower()
{
child = (GtkWidget*)chd->data;
Br = (gControl *)g_object_get_data(G_OBJECT(child), "gambas-control");;
br = (gControl *)g_object_get_data(G_OBJECT(child), "gambas-control");;
if (Br && Br != this)
if (br && br != this)
{
x = Br->x();
y = Br->y();
g_object_ref(G_OBJECT(Br->border));
gtk_container_remove(GTK_CONTAINER(pr->getContainer()),Br->border);
gtk_container_add(GTK_CONTAINER(pr->getContainer()),Br->border);
pr->moveChild(Br, x, y);
g_object_unref(G_OBJECT(Br->border));
x = br->x();
y = br->y();
parent = GTK_CONTAINER(gtk_widget_get_parent(br->border));
g_object_ref(G_OBJECT(br->border));
gtk_container_remove(parent, br->border);
gtk_container_add(parent, br->border);
if (GTK_IS_LAYOUT(parent))
gtk_layout_move(GTK_LAYOUT(parent), br->border, x, y);
else
gtk_fixed_move(GTK_FIXED(parent), br->border, x, y);
g_object_unref(G_OBJECT(br->border));
}
chd = g_list_next(chd);
@ -1025,7 +1032,8 @@ void gControl::lower()
void gControl::raise()
{
int x,y;
int x, y;
GtkContainer *parent;
if (!pr) return;
if (pr->getClass()==Type_gSplitter) return;
@ -1040,17 +1048,23 @@ void gControl::raise()
{
//fprintf(stderr, "gb.gtk: warning: gControl::raise(): no window\n");
x=left();
y=top();
x = left();
y = top();
parent = GTK_CONTAINER(gtk_widget_get_parent(border));
g_object_ref(G_OBJECT(border));
gtk_container_remove(GTK_CONTAINER(pr->getContainer()),border);
gtk_container_add(GTK_CONTAINER(pr->getContainer()),border);
pr->moveChild(this, x, y);
gtk_container_remove(parent, border);
gtk_container_add(parent, border);
//pr->moveChild(this, x, y);
if (GTK_IS_LAYOUT(parent))
gtk_layout_move(GTK_LAYOUT(parent), border, x, y);
else
gtk_fixed_move(GTK_FIXED(parent), border, x, y);
g_object_unref(G_OBJECT(border));
}
g_ptr_array_remove(pr->_children, this);
g_ptr_array_add(pr->_children, this);
pr->updateFocusChain();

View file

@ -28,7 +28,7 @@
#include "gdesktop.h"
#include "gtabstrip.h"
#if 0
static int gTabStrip_buttonRelease(GtkWidget *wid,GdkEventButton *e,gTabStrip *d)
{
if (!gApplication::userEvents()) return false;
@ -59,6 +59,7 @@ static int gTabStrip_buttonPress(GtkWidget *wid,GdkEventButton *e,gTabStrip *d)
}
return false;
}
#endif
static void cb_click(GtkNotebook *nb,GtkNotebookPage *pg,guint pnum,gTabStrip *data)
{
@ -688,7 +689,6 @@ gControl *gTabStrip::tabChild(int ind, int n) const
}
return NULL;
}
int gTabStrip::childCount() const
@ -788,4 +788,18 @@ void gTabStrip::setClosable(bool v)
get(i)->updateButton();
}
int gTabStrip::findIndex(gControl *child) const
{
int i;
GtkWidget *page;
page = gtk_widget_get_parent(child->border);
for (i = 0; i < count(); i++)
{
if (get(i)->widget == page)
return i;
}
return -1;
}

View file

@ -45,6 +45,7 @@ public:
char *tabText(int ind) const;
int tabCount(int ind) const;
gControl *tabChild(int ind, int n) const;
int findIndex(gControl *child) const;
bool setCount(int vl);
void setIndex(int vl);

View file

@ -188,8 +188,8 @@ extern "C"
CColumnViewColumnsDesc,
CColumnViewDesc,
CTabStripDesc,
CTabDesc,
CTabChildrenDesc,
CTabStripContainerDesc,
CTabStripContainerChildrenDesc,
CPluginDesc,
CScrollViewDesc,
CSpinBoxDesc,

View file

@ -430,7 +430,7 @@ static int get_real_index(CTABSTRIP *_object)
}
BEGIN_METHOD(CTABSTRIP_new, GB_OBJECT parent)
BEGIN_METHOD(TabStrip_new, GB_OBJECT parent)
MyTabWidget *wid = new MyTabWidget(QCONTAINER(VARG(parent))); //, 0, Qt::WNoMousePropagation);
@ -456,7 +456,7 @@ BEGIN_METHOD_VOID(TabStrip_free)
END_METHOD
BEGIN_PROPERTY(CTABSTRIP_count)
BEGIN_PROPERTY(TabStrip_Count)
if (READ_PROPERTY)
GB.ReturnInteger(WIDGET->stack.count());
@ -466,7 +466,7 @@ BEGIN_PROPERTY(CTABSTRIP_count)
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_index)
BEGIN_PROPERTY(TabStrip_Index)
if (READ_PROPERTY)
{
@ -491,7 +491,7 @@ BEGIN_PROPERTY(CTABSTRIP_index)
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_current)
BEGIN_PROPERTY(TabStrip_Current)
THIS->index = get_real_index(THIS);
if (THIS->index < 0)
@ -502,7 +502,7 @@ BEGIN_PROPERTY(CTABSTRIP_current)
END_PROPERTY
BEGIN_METHOD(CTABSTRIP_get, GB_INTEGER index)
BEGIN_METHOD(TabStrip_get, GB_INTEGER index)
int index = VARG(index);
@ -515,7 +515,7 @@ BEGIN_METHOD(CTABSTRIP_get, GB_INTEGER index)
END_METHOD
BEGIN_PROPERTY(CTABSTRIP_orientation)
BEGIN_PROPERTY(TabStrip_Orientation)
if (READ_PROPERTY)
{
@ -726,7 +726,7 @@ BEGIN_METHOD_VOID(CTAB_delete)
END_METHOD
BEGIN_PROPERTY(CTABSTRIP_enabled)
BEGIN_PROPERTY(TabStrip_Enabled)
int i;
@ -742,7 +742,7 @@ BEGIN_PROPERTY(CTABSTRIP_enabled)
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_text)
BEGIN_PROPERTY(TabStrip_Text)
THIS->index = -1;
CTAB_text(_object, _param);
@ -755,7 +755,7 @@ BEGIN_PROPERTY(CTABSTRIP_text)
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_picture)
BEGIN_PROPERTY(TabStrip_Picture)
THIS->index = -1;
CTAB_picture(_object, _param);
@ -772,34 +772,58 @@ BEGIN_PROPERTY(TabStrip_Closable)
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_client_x)
BEGIN_PROPERTY(TabStrip_ClientX)
Container_X(_object, _param);
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_client_y)
BEGIN_PROPERTY(TabStrip_ClientY)
Container_Y(_object, _param);
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_client_width)
BEGIN_PROPERTY(TabStrip_ClientWidth)
GB.ReturnInteger(THIS->container->width());
END_PROPERTY
BEGIN_PROPERTY(CTABSTRIP_client_height)
BEGIN_PROPERTY(TabStrip_ClientHeight)
GB.ReturnInteger(THIS->container->height());
END_PROPERTY
BEGIN_METHOD(TabStrip_FindIndex, GB_OBJECT child)
void *child = VARG(child);
int i;
QWidget *parent;
if (GB.CheckObject(child))
return;
parent = QWIDGET(child)->parentWidget();
for (i = 0; i < WIDGET->stack.count(); i++)
{
if (parent == WIDGET->stack.at(i)->widget)
{
GB.ReturnInteger(i);
return;
}
}
GB.ReturnInteger(-1);
END_METHOD
/** Class CTabStrip ******************************************************/
@ -841,9 +865,9 @@ void CTabStrip::tabCloseRequested(int index)
/** Descriptions *********************************************************/
GB_DESC CTabChildrenDesc[] =
GB_DESC CTabStripContainerChildrenDesc[] =
{
GB_DECLARE(".Tab.Children", 0), GB_VIRTUAL_CLASS(),
GB_DECLARE_VIRTUAL(".TabStripContainer.Children"),
GB_METHOD("_next", "Control", CTAB_next, NULL),
GB_PROPERTY_READ("Count", "i", CTAB_count),
@ -853,16 +877,16 @@ GB_DESC CTabChildrenDesc[] =
};
GB_DESC CTabDesc[] =
GB_DESC CTabStripContainerDesc[] =
{
GB_DECLARE(".Tab", 0), GB_VIRTUAL_CLASS(),
GB_DECLARE_VIRTUAL(".TabStripContainer"),
GB_PROPERTY("Text", "s", CTAB_text),
GB_PROPERTY("Picture", "Picture", CTAB_picture),
GB_PROPERTY("Caption", "s", CTAB_text),
GB_PROPERTY("Enabled", "b", CTAB_enabled),
GB_PROPERTY("Visible", "b", CTAB_visible),
GB_PROPERTY_SELF("Children", ".Tab.Children"),
GB_PROPERTY_SELF("Children", ".TabStripContainer.Children"),
GB_METHOD("Delete", NULL, CTAB_delete, NULL),
GB_END_DECLARE
@ -873,26 +897,26 @@ GB_DESC CTabStripDesc[] =
{
GB_DECLARE("TabStrip", sizeof(CTABSTRIP)), GB_INHERITS("Container"),
GB_METHOD("_new", NULL, CTABSTRIP_new, "(Parent)Container;"),
GB_METHOD("_new", NULL, TabStrip_new, "(Parent)Container;"),
GB_METHOD("_free", NULL, TabStrip_free, NULL),
GB_PROPERTY("Count", "i", CTABSTRIP_count),
GB_PROPERTY("Text", "s", CTABSTRIP_text),
GB_PROPERTY("Count", "i", TabStrip_Count),
GB_PROPERTY("Text", "s", TabStrip_Text),
GB_PROPERTY("TextFont", "Font", TabStrip_TextFont),
GB_PROPERTY("Picture", "Picture", CTABSTRIP_picture),
GB_PROPERTY("Picture", "Picture", TabStrip_Picture),
GB_PROPERTY("Closable", "b", TabStrip_Closable),
GB_PROPERTY("Caption", "s", CTABSTRIP_text),
GB_PROPERTY_READ("Current", ".Tab", CTABSTRIP_current),
GB_PROPERTY("Index", "i", CTABSTRIP_index),
GB_PROPERTY("Orientation", "i", CTABSTRIP_orientation),
GB_PROPERTY("Enabled", "b", CTABSTRIP_enabled),
GB_PROPERTY("Caption", "s", TabStrip_Text),
GB_PROPERTY_READ("Current", ".TabStripContainer", TabStrip_Current),
GB_PROPERTY("Index", "i", TabStrip_Index),
GB_PROPERTY("Orientation", "i", TabStrip_Orientation),
GB_PROPERTY("Enabled", "b", TabStrip_Enabled),
GB_PROPERTY_READ("ClientX", "i", CTABSTRIP_client_x),
GB_PROPERTY_READ("ClientY", "i", CTABSTRIP_client_y),
GB_PROPERTY_READ("ClientW", "i", CTABSTRIP_client_width),
GB_PROPERTY_READ("ClientWidth", "i", CTABSTRIP_client_width),
GB_PROPERTY_READ("ClientH", "i", CTABSTRIP_client_height),
GB_PROPERTY_READ("ClientHeight", "i", CTABSTRIP_client_height),
GB_PROPERTY_READ("ClientX", "i", TabStrip_ClientX),
GB_PROPERTY_READ("ClientY", "i", TabStrip_ClientY),
GB_PROPERTY_READ("ClientW", "i", TabStrip_ClientWidth),
GB_PROPERTY_READ("ClientWidth", "i", TabStrip_ClientWidth),
GB_PROPERTY_READ("ClientH", "i", TabStrip_ClientHeight),
GB_PROPERTY_READ("ClientHeight", "i", TabStrip_ClientHeight),
GB_PROPERTY("Arrangement", "i", Container_Arrangement),
GB_PROPERTY("AutoResize", "b", Container_AutoResize),
@ -902,7 +926,8 @@ GB_DESC CTabStripDesc[] =
GB_PROPERTY("Indent", "b", Container_Indent),
GB_PROPERTY("Invert", "b", Container_Invert),
GB_METHOD("_get", ".Tab", CTABSTRIP_get, "(Index)i"),
GB_METHOD("_get", ".TabStripContainer", TabStrip_get, "(Index)i"),
GB_METHOD("FindIndex", "i", TabStrip_FindIndex, "(Child)Control;"),
TABSTRIP_DESCRIPTION,

View file

@ -37,8 +37,8 @@
#ifndef __CTABSTRIP_CPP
extern GB_DESC CTabStripDesc[];
extern GB_DESC CTabDesc[];
extern GB_DESC CTabChildrenDesc[];
extern GB_DESC CTabStripContainerDesc[];
extern GB_DESC CTabStripContainerChildrenDesc[];
#else
#define QTABWIDGET(object) ((MyTabWidget *)((CWIDGET *)object)->widget)
@ -60,9 +60,7 @@ typedef
QWidget *container;
CARRANGEMENT arrangement;
CFONT *textFont;
int index;
int id;
unsigned geom : 1;
int index;
unsigned lock : 1;
}
CTABSTRIP;

View file

@ -576,12 +576,14 @@ static QColor calc_color(QColor ca, QColor cb, QColor cd)
if (!cb.isValid())
return ca;
#define test(x) r *= x.red(); g *= x.green(); b *= x.blue(); n++;
return QColor((ca.red() + cb.red()) / 2, (ca.green() + cb.green()) / 2, (ca.blue() + cb.blue()) / 2);
/*#define test(x) r *= x.red(); g *= x.green(); b *= x.blue(); n++;
test(ca);
test(cb);
n = (n == 2) ? 255 : (n == 3) ? 255*255 : 1;
return QColor(r / n, g / n, b / n);
return QColor(r / n, g / n, b / n);*/
}
void GEditor::drawTextWithTab(QPainter &p, int sx, int x, int y, const QString &s)

View file

@ -1033,7 +1033,7 @@ GB_DESC *GB_CLASSES[] EXPORT =
//CColumnView2ItemDesc, CColumnView2ColumnDesc, CColumnView2ColumnsDesc, CColumnView2Desc,
CFrameDesc, CPanelDesc, CHBoxDesc, CVBoxDesc, CHPanelDesc, CVPanelDesc,
CHSplitDesc, CVSplitDesc,
CTabChildrenDesc, CTabDesc, CTabStripDesc,
CTabStripContainerChildrenDesc, CTabStripContainerDesc, CTabStripDesc,
CScrollViewDesc,
CDrawingAreaDesc,
CProgressDesc, CSliderDesc, CSpinBoxDesc, CMovieBoxDesc, CScrollBarDesc,