[DEVELOPMENT ENVIRONMENT]
* NEW: Use the new mascot to draw project directory icon. [EXAMPLES] * NEW: Some little changes in the Painting example. [INTERPRETER] * NEW: The component GB_INIT function now returns an integer that gives an unloading order. The higher the returned number, the later the component is unloaded. If GB_INIT returns -1, then the component shared library will not be unloaded. * NEW: Update GB_INIT functions in all components. [GB.DRAW] * BUG: Paint.Image() optional translation arguments are not inverted anymore. [GB.QT4] * BUG: If Paint.LineWidth is zero, then nothing is stroked, as in gb.gtk. * BUG: TabStrip is now correctly arranged when it has only one tab. git-svn-id: svn://localhost/gambas/trunk@2605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
09916d0a4b
commit
61997e8921
@ -436,7 +436,7 @@ msgstr ""
|
||||
#: FConnectionEditor.class:261 FCreateFile.class:885 FDebugInfo.class:490
|
||||
#: FEditor.class:2132 FFindList.class:195 FFind.class:114
|
||||
#: FFontChooser.class:86 FForm.class:2836 FGotoLine.class:63
|
||||
#: FHelpBrowser.class:285 FIconEditor.class:1393 FImportTable.class:38
|
||||
#: FHelpBrowser.class:270 FIconEditor.class:1393 FImportTable.class:38
|
||||
#: FList.class:155 FMain.class:204 FMakeExecutable.class:144
|
||||
#: FMakeInstall.class:309 FMenu.class:1128 FNewConnection.class:317
|
||||
#: FNewTable.class:168 FNewTranslation.class:70 FOpenProject.class:146
|
||||
@ -638,7 +638,7 @@ msgstr ""
|
||||
msgid "Default value"
|
||||
msgstr ""
|
||||
|
||||
#: FConnectionEditor.class:58 FDebugExpr.class:425 FHelpBrowser.class:257
|
||||
#: FConnectionEditor.class:58 FDebugExpr.class:425 FHelpBrowser.class:242
|
||||
msgid "Index"
|
||||
msgstr ""
|
||||
|
||||
@ -781,7 +781,7 @@ msgid "Connection editor"
|
||||
msgstr ""
|
||||
|
||||
#: FConnectionEditor.class:1547 FEditor.class:2132 FForm.class:2836
|
||||
#: FHelpBrowser.class:292 FIconEditor.class:2032 FTextEditor.class:462
|
||||
#: FHelpBrowser.class:277 FIconEditor.class:2032 FTextEditor.class:462
|
||||
#: FTranslate.class:700
|
||||
msgid "Reload"
|
||||
msgstr ""
|
||||
@ -1229,7 +1229,7 @@ msgstr ""
|
||||
msgid "Find definition"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3148 FHelpBrowser.class:271
|
||||
#: FEditor.class:3148 FHelpBrowser.class:256
|
||||
msgid "Go back"
|
||||
msgstr ""
|
||||
|
||||
@ -1608,31 +1608,31 @@ msgstr ""
|
||||
msgid "Go to line"
|
||||
msgstr ""
|
||||
|
||||
#: FHelpBrowser.class:245
|
||||
#: FHelpBrowser.class:230
|
||||
msgid "Help browser"
|
||||
msgstr ""
|
||||
|
||||
#: FHelpBrowser.class:278
|
||||
#: FHelpBrowser.class:263
|
||||
msgid "Go forward"
|
||||
msgstr ""
|
||||
|
||||
#: FHelpBrowser.class:311 FIconEditor.class:2225
|
||||
#: FHelpBrowser.class:296 FIconEditor.class:2225
|
||||
msgid "Zoom in"
|
||||
msgstr ""
|
||||
|
||||
#: FHelpBrowser.class:318 FIconEditor.class:2234
|
||||
#: FHelpBrowser.class:303 FIconEditor.class:2234
|
||||
msgid "Zoom out"
|
||||
msgstr ""
|
||||
|
||||
#: FHelpBrowser.class:325
|
||||
#: FHelpBrowser.class:310
|
||||
msgid "No zoom"
|
||||
msgstr ""
|
||||
|
||||
#: FHelpBrowser.class:337
|
||||
#: FHelpBrowser.class:322
|
||||
msgid "Modify documentation..."
|
||||
msgstr ""
|
||||
|
||||
#: FHelpBrowser.class:345
|
||||
#: FHelpBrowser.class:329
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
|
@ -191,22 +191,7 @@ Public Sub btnPrint_Click()
|
||||
|
||||
Printer1.OutputFile = "~/print.pdf"
|
||||
$bPrint = False
|
||||
Printer1.Run
|
||||
If $bPrint Then webHelp.Current.Print(Printer1)
|
||||
'Printer1.Run
|
||||
|
||||
End
|
||||
|
||||
Public Sub Printer1_Begin()
|
||||
|
||||
$bPrint = True
|
||||
Printer1.Cancel
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub Printer1_Draw()
|
||||
|
||||
Debug
|
||||
If Printer1.Configure() Then Return
|
||||
webHelp.Current.Print(Printer1)
|
||||
|
||||
End
|
||||
|
@ -86,7 +86,6 @@
|
||||
}
|
||||
{ btnPrint ToolButton
|
||||
MoveScaled(71,0,15,4)
|
||||
Visible = False
|
||||
AutoResize = True
|
||||
Text = ("Print")
|
||||
Picture = Picture["icon:/small/print"]
|
||||
|
@ -4492,7 +4492,7 @@ Public Sub MakeDirectoryIcon(Optional sDir As String)
|
||||
|
||||
If sIcon Then
|
||||
Try hIcon = StretchIcon(sIcon, 16)
|
||||
If hIcon Then hDirIcon.Draw(hIcon, 26, 47)
|
||||
If hIcon Then hDirIcon.Draw(hIcon, 40, 34)
|
||||
Endif
|
||||
|
||||
hDirIcon.Save(sDir &/ ".icon.png")
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 4.1 KiB |
@ -277,15 +277,26 @@ End
|
||||
|
||||
Public Sub Example11()
|
||||
|
||||
Dim hImg As Image
|
||||
hImg = Image.Load(IMAGE_NAME)
|
||||
Dim X, Y, W, H As Float
|
||||
Dim hBrush As PaintBrush
|
||||
Dim hImage As Image
|
||||
|
||||
Paint.Translate(128, 128)
|
||||
'Paint.Rotate(Rad(45))
|
||||
Paint.Scale(256.0 / hImg.W, 256.0 / hImg.H)
|
||||
Paint.Translate(-0.5 * hImg.W, -0.5 * hImg.H)
|
||||
Paint.Brush = Paint.Image(hImg, 0, 0)
|
||||
Paint.Rectangle(0, 0, 256, 256)
|
||||
hImage = Image.Load(IMAGE_NAME)
|
||||
|
||||
X = 16
|
||||
Y = 40
|
||||
W = 200
|
||||
H = 200
|
||||
|
||||
hBrush = Paint.Image(hImage)
|
||||
hBrush.Translate(X, Y)
|
||||
hBrush.Scale(W / hImage.W, H / hImage.H)
|
||||
Paint.Brush = hBrush
|
||||
Paint.Rectangle(X, Y, W, H)
|
||||
Paint.Fill
|
||||
|
||||
Paint.Brush = Paint.Color(Color.RGB(255, 127, 127, 153))
|
||||
Paint.Arc(X, Y, 10)
|
||||
Paint.Fill
|
||||
|
||||
End
|
||||
@ -344,7 +355,7 @@ Public Sub Example14()
|
||||
|
||||
'Draw helping lines
|
||||
Paint.Brush = Paint.Color(Color.RGB(255, 31, 31))
|
||||
Paint.LineWidth = 2.56
|
||||
Paint.LineWidth = 6
|
||||
Paint.MoveTo(64, 50)
|
||||
Paint.LineTo(64, 200)
|
||||
Paint.MoveTo(128, 50)
|
||||
@ -352,6 +363,7 @@ Public Sub Example14()
|
||||
Paint.MoveTo(192, 50)
|
||||
Paint.LineTo(192, 200)
|
||||
Paint.Stroke
|
||||
|
||||
End
|
||||
|
||||
Public Sub Example15()
|
||||
@ -457,18 +469,20 @@ Public Sub Example20()
|
||||
|
||||
End
|
||||
|
||||
Private $hSvgImage As SvgImage
|
||||
|
||||
Public Sub Example21()
|
||||
|
||||
Dim hSvgImage As SvgImage
|
||||
|
||||
hSvgImage = SvgImage.Load("gambas.svg")
|
||||
Paint.Begin(hSvgImage)
|
||||
If Not $hSvgImage Then
|
||||
$hSvgImage = SvgImage.Load("gambas.svg")
|
||||
Paint.Begin($hSvgImage)
|
||||
Paint.Brush = Paint.RadialGradient(200, 140, 40, 215, 115, [Color.RGB(255, 0, 0, 64), Color.White], [1.0, 0.1])
|
||||
Paint.Arc(200, 140, 40)
|
||||
Paint.Fill
|
||||
Paint.End
|
||||
Endif
|
||||
|
||||
hSvgImage.Paint
|
||||
$hSvgImage.Paint
|
||||
|
||||
End
|
||||
|
||||
|
@ -1,14 +1,25 @@
|
||||
Public Sub Example11()
|
||||
|
||||
Dim hImg As Image
|
||||
hImg = Image.Load(IMAGE_NAME)
|
||||
Dim X, Y, W, H As Float
|
||||
Dim hBrush As PaintBrush
|
||||
Dim hImage As Image
|
||||
|
||||
Paint.Translate(128, 128)
|
||||
Paint.Rotate(Rad(45))
|
||||
Paint.Scale(256.0 / hImg.W, 256.0 / hImg.H)
|
||||
Paint.Translate(-0.5 * hImg.W, -0.5 * hImg.H)
|
||||
Paint.Brush = Paint.Image(hImg, 0, 0)
|
||||
Paint.Rectangle(0, 0, 256, 256)
|
||||
hImage = Image.Load(IMAGE_NAME)
|
||||
|
||||
X = 16
|
||||
Y = 40
|
||||
W = 200
|
||||
H = 200
|
||||
|
||||
hBrush = Paint.Image(hImage)
|
||||
hBrush.Translate(X, Y)
|
||||
hBrush.Scale(W / hImage.W, H / hImage.H)
|
||||
Paint.Brush = hBrush
|
||||
Paint.Rectangle(X, Y, W, H)
|
||||
Paint.Fill
|
||||
|
||||
Paint.Brush = Paint.Color(Color.RGB(255, 127, 127, 153))
|
||||
Paint.Arc(X, Y, 10)
|
||||
Paint.Fill
|
||||
|
||||
End
|
||||
|
@ -6,7 +6,7 @@ Public Sub Example12()
|
||||
hImg = Image.Load(IMAGE_NAME)
|
||||
|
||||
Paint.Translate(128, 128)
|
||||
Paint.Rotate(Pi / 4)
|
||||
'Paint.Rotate(Pi / 4)
|
||||
Paint.Scale(1 / Sqr(2), 1 / Sqr(2))
|
||||
Paint.Translate(-128, -128)
|
||||
hBrush = Paint.Image(himg, 0, 0)
|
||||
|
@ -16,7 +16,7 @@ Public Sub Example14()
|
||||
|
||||
'Draw helping lines
|
||||
Paint.Brush = Paint.Color(Color.RGB(255, 31, 31))
|
||||
Paint.LineWidth = 2.56
|
||||
Paint.LineWidth = 6
|
||||
Paint.MoveTo(64, 50)
|
||||
Paint.LineTo(64, 200)
|
||||
Paint.MoveTo(128, 50)
|
||||
@ -24,4 +24,5 @@ Public Sub Example14()
|
||||
Paint.MoveTo(192, 50)
|
||||
Paint.LineTo(192, 200)
|
||||
Paint.Stroke
|
||||
|
||||
End
|
||||
|
@ -21,12 +21,15 @@ Public Sub Example17()
|
||||
Paint.Fill
|
||||
|
||||
Paint.Brush = Paint.Color(Color.RGB(255, 31, 31, 93))
|
||||
Paint.LineWidth = 6
|
||||
Paint.LineWidth = 1
|
||||
Paint.Arc(X, Y, 10)
|
||||
Paint.Fill
|
||||
Paint.MoveTo(X, Y)
|
||||
Paint.RelLineTo(0, Paint.Font.Descent - hExt.Height)
|
||||
Paint.RelLineTo(hExt.Width, 0)
|
||||
Paint.Stroke
|
||||
'Paint.MoveTo(X, Y)
|
||||
'Paint.RelLineTo(0, Paint.Font.Descent - hExt.Height)
|
||||
'Paint.RelLineTo(hExt.Width, 0)
|
||||
'Paint.Stroke
|
||||
Paint.Brush = Paint.Color(Color.RGB(255, 31, 31, 192))
|
||||
Paint.Rectangle(hExt.X, hExt.Y, hExt.Width, hExt.Height)
|
||||
Paint.Fill
|
||||
|
||||
End
|
||||
|
@ -1,14 +1,14 @@
|
||||
Public Sub Example21()
|
||||
|
||||
Dim hSvgImage As SvgImage
|
||||
|
||||
hSvgImage = SvgImage.Load("gambas.svg")
|
||||
Paint.Begin(hSvgImage)
|
||||
If Not $hSvgImage Then
|
||||
$hSvgImage = SvgImage.Load("gambas.svg")
|
||||
Paint.Begin($hSvgImage)
|
||||
Paint.Brush = Paint.RadialGradient(200, 140, 40, 215, 115, [Color.RGB(255, 0, 0, 64), Color.White], [1.0, 0.1])
|
||||
Paint.Arc(200, 140, 40)
|
||||
Paint.Fill
|
||||
Paint.End
|
||||
Endif
|
||||
|
||||
hSvgImage.Paint
|
||||
$hSvgImage.Paint
|
||||
|
||||
End
|
||||
|
@ -40,7 +40,7 @@ GB_DESC *GB_CLASSES[] EXPORT =
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -574,7 +574,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.compress", COMPRESS_INTERFACE_VERSION, &COMPRESSION);
|
||||
COMPRESSION.Register(&_driver);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -489,7 +489,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.compress", COMPRESS_INTERFACE_VERSION, &COMPRESSION);
|
||||
COMPRESSION.Register(&_driver);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -84,7 +84,7 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -2390,7 +2390,7 @@ extern "C" {
|
||||
GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB);
|
||||
DB.Register(&_driver);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -2504,7 +2504,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB);
|
||||
DB.Register(&_driver);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -2732,7 +2732,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB);
|
||||
DB.Register(&_driver);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -2478,7 +2478,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB);
|
||||
DB.Register(&_driver);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -2718,7 +2718,7 @@ extern "C"
|
||||
GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB);
|
||||
DB.Register(&_driver);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -43,7 +43,7 @@ GB_DESC *GB_CLASSES[] EXPORT =
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
CLASS_DBusVariant = GB.FindClass("DBusVariant");
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -39,7 +39,8 @@ GB_DESC *GB_CLASSES[] EXPORT =
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE);
|
||||
return 0;
|
||||
// Must be not be unloaded, because libxtst registers some exit procedure called at XCloseDisplay()
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT(void)
|
||||
|
@ -53,7 +53,7 @@ int EXPORT GB_INIT(void)
|
||||
{
|
||||
GB.GetInterface("gb.gtk", GTK_INTERFACE_VERSION, >K);
|
||||
GB.GetInterface("gb.draw", DRAW_INTERFACE_VERSION, &DRAW);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -255,8 +255,7 @@ void gTabStripPage::setVisible(bool v)
|
||||
gtk_widget_show_all(widget);
|
||||
gtk_widget_show_all(fix);
|
||||
//gtk_container_resize_children(GTK_CONTAINER(gtk_widget_get_parent(widget)));
|
||||
if (parent->isVisible())
|
||||
gtk_container_resize_children(GTK_CONTAINER(gtk_widget_get_parent(gtk_widget_get_parent(widget))));
|
||||
//gtk_container_resize_children(GTK_CONTAINER(gtk_widget_get_parent(gtk_widget_get_parent(widget))));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -259,7 +259,7 @@ extern "C"
|
||||
CLASS_Image = GB.FindClass("Image");
|
||||
CLASS_SvgImage = GB.FindClass("SvgImage");
|
||||
|
||||
return TRUE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -47,7 +47,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.gtk", GTK_INTERFACE_VERSION, >K);
|
||||
GB.GetInterface("gb.opengl", GL_INTERFACE_VERSION, &GL);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -38,7 +38,7 @@ int EXPORT GB_INIT(void)
|
||||
{
|
||||
GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE);
|
||||
imlib_set_cache_size(0);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -41,7 +41,7 @@ int EXPORT GB_INIT(void)
|
||||
// Bug in the gdk-pixbuf documentation: the following is mandatory.
|
||||
g_type_init();
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -39,7 +39,7 @@ GB_DESC *GB_CLASSES[] EXPORT =
|
||||
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -86,7 +86,7 @@ int EXPORT GB_INIT(void)
|
||||
{
|
||||
GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -41,7 +41,7 @@ int EXPORT GB_INIT(void)
|
||||
{
|
||||
GB.GetInterface("gb.qt", QT_INTERFACE_VERSION, &QT);
|
||||
|
||||
return TRUE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -239,7 +239,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.Hook(GB_HOOK_MAIN, (void *)hook_main);
|
||||
old_hook_lang = GB.Hook(GB_HOOK_LANG, (void *)hook_lang);
|
||||
|
||||
return TRUE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -217,7 +217,7 @@ void FUNCTION_NAME(void *_object) //(QFrame *cont)
|
||||
wc -= padding * 2;
|
||||
hc -= padding * 2;
|
||||
|
||||
//if (!strcmp(GET_OBJECT_NAME(_object), "HBox1"))
|
||||
//if (!strcmp(GET_OBJECT_NAME(_object), "TabStrip1"))
|
||||
// fprintf(stderr, "#0: %d %d %d %d\n", xc, yc, wc, hc);
|
||||
|
||||
if (indent)
|
||||
|
@ -82,7 +82,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.qt", QT_INTERFACE_VERSION, &QT);
|
||||
DRAW_init();
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -925,7 +925,7 @@ int EXPORT GB_INIT(void)
|
||||
|
||||
QT_InitEventLoop();
|
||||
|
||||
return TRUE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -45,7 +45,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.qt", QT_INTERFACE_VERSION, &QT);
|
||||
GB.GetInterface("gb.opengl", GL_INTERFACE_VERSION, &GL);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "CWindow.h"
|
||||
#include "CConst.h"
|
||||
#include "CScrollView.h"
|
||||
#include "CTabStrip.h"
|
||||
#include "CColor.h"
|
||||
|
||||
#include "CContainer.h"
|
||||
@ -204,7 +205,22 @@ static void flush_cache()
|
||||
_cache.clear();
|
||||
}
|
||||
|
||||
#else
|
||||
#if 0
|
||||
|
||||
static void get_widget_contents(QWidget *wid, int &x, int &y, int &w, int &h)
|
||||
{
|
||||
QRect wc;
|
||||
|
||||
wc = wid->contentsRect();
|
||||
|
||||
x = wc.x();
|
||||
y = wc.y();
|
||||
w = wc.width();
|
||||
h = wc.height();
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void resize_container(void *_object, QWidget *cont, int w, int h)
|
||||
@ -249,6 +265,7 @@ static void resize_container(void *_object, QWidget *cont, int w, int h)
|
||||
|
||||
#else
|
||||
|
||||
//#define GET_WIDGET_CONTENTS(_widget, _x, _y, _w, _h) get_widget_contents(_widget, _x, _y, _w, _h)
|
||||
#define GET_WIDGET_CONTENTS(_widget, _x, _y, _w, _h) \
|
||||
_x = (_widget)->contentsRect().x(); \
|
||||
_y = (_widget)->contentsRect().y(); \
|
||||
@ -276,6 +293,8 @@ static void resize_container(void *_object, QWidget *cont, int w, int h)
|
||||
|
||||
#define GET_OBJECT_FROM_WIDGET(_widget) CWidget::getRealExisting(_widget)
|
||||
|
||||
#define GET_OBJECT_NAME(_object) (((CWIDGET *)_object)->name)
|
||||
|
||||
#define RAISE_ARRANGE_EVENT(_object) \
|
||||
{ \
|
||||
GB.Raise(_object, EVENT_Arrange, 0); \
|
||||
@ -296,6 +315,8 @@ void CCONTAINER_arrange(void *_object)
|
||||
{
|
||||
if (GB.Is(THIS, CLASS_ScrollView))
|
||||
CSCROLLVIEW_arrange(THIS);
|
||||
else if (GB.Is(THIS, CLASS_TabStrip))
|
||||
CTABSTRIP_arrange(THIS);
|
||||
|
||||
#if DEBUG_CONTAINER
|
||||
static int level = 0;
|
||||
@ -452,9 +473,12 @@ void MyContainer::showEvent(QShowEvent *e)
|
||||
void *_object = CWidget::get(this);
|
||||
QWidget::showEvent(e);
|
||||
THIS->widget.flag.shown = TRUE;
|
||||
CCONTAINER_arrange(THIS);
|
||||
//if (!qstrcmp(GB.GetClassName(THIS), "ListContainer"))
|
||||
// if (!qstrcmp(GB.GetClassName(THIS), "TabStrip"))
|
||||
// {
|
||||
// qDebug("MyContainer::showEvent: %s %p: SHOWN = 1 (%d %d)", THIS->widget.name, THIS, THIS->widget.widget->isVisible() , !THIS->widget.widget->isHidden());
|
||||
// BREAKPOINT();
|
||||
// }
|
||||
CCONTAINER_arrange(THIS);
|
||||
}
|
||||
|
||||
void MyContainer::hideEvent(QHideEvent *e)
|
||||
|
@ -42,6 +42,11 @@ DECLARE_METHOD(CCONTAINER_y);
|
||||
|
||||
DECLARE_EVENT(EVENT_Click);
|
||||
|
||||
void CTABSTRIP_arrange(void *_object)
|
||||
{
|
||||
WIDGET->forceLayout();
|
||||
}
|
||||
|
||||
/** CTab *****************************************************************/
|
||||
|
||||
class CTab
|
||||
@ -335,7 +340,6 @@ BEGIN_METHOD(CTABSTRIP_new, GB_OBJECT parent)
|
||||
|
||||
CWIDGET_new(wid, (void *)_object, true);
|
||||
set_tab_count(THIS, 1);
|
||||
wid->show();
|
||||
|
||||
//wid->updateLayout();
|
||||
|
||||
@ -726,15 +730,13 @@ void CTabStrip::currentChanged(int index)
|
||||
|
||||
wid = WIDGET->currentWidget();
|
||||
|
||||
//qDebug("CTabStrip::currentChanged: %d %p -> %p", index, THIS->container, wid);
|
||||
|
||||
if (wid != THIS->container)
|
||||
{
|
||||
//qDebug("CTabStrip::currentChanged: %d %p -> %p", index, THIS->container, wid);
|
||||
if (THIS->container)
|
||||
THIS->container->hide();
|
||||
THIS->container = wid;
|
||||
wid->show();
|
||||
WIDGET->forceLayout();
|
||||
CCONTAINER_arrange(THIS);
|
||||
|
||||
//if (wid->isVisible() && !THIS->lock)
|
||||
@ -789,14 +791,12 @@ GB_DESC CTabStripDesc[] =
|
||||
GB_PROPERTY("Orientation", "i", CTABSTRIP_orientation),
|
||||
GB_PROPERTY("Enabled", "b", CTABSTRIP_enabled),
|
||||
|
||||
#ifdef GB_QT_COMPONENT
|
||||
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),
|
||||
#endif
|
||||
|
||||
GB_PROPERTY("Arrangement", "i", CCONTAINER_arrangement),
|
||||
GB_PROPERTY("AutoResize", "b", CCONTAINER_auto_resize),
|
||||
|
@ -99,4 +99,6 @@ public slots:
|
||||
void currentChanged(int);
|
||||
};
|
||||
|
||||
void CTABSTRIP_arrange(void *_object);
|
||||
|
||||
#endif
|
||||
|
@ -263,7 +263,7 @@ void CWIDGET_new(QWidget *w, void *_object, bool no_show, bool no_filter, bool n
|
||||
|
||||
if (!no_show)
|
||||
{
|
||||
w->setGeometry(-16, -16, 16, 16);
|
||||
w->setGeometry(-32, -32, 32, 32);
|
||||
CWIDGET_set_visible(THIS, true);
|
||||
w->raise();
|
||||
}
|
||||
|
@ -318,6 +318,8 @@ static void Stroke(GB_PAINT *d, int preserve)
|
||||
{
|
||||
CHECK_PATH(d);
|
||||
|
||||
if (PAINTER(d)->pen().widthF() > 0.0)
|
||||
{
|
||||
if (!CLIP(d))
|
||||
PAINTER(d)->strokePath(*PATH(d), PAINTER(d)->pen());
|
||||
else
|
||||
@ -336,6 +338,7 @@ static void Stroke(GB_PAINT *d, int preserve)
|
||||
path = path.intersected(stroker.createStroke(*PATH(d)));
|
||||
PAINTER(d)->fillPath(path, PAINTER(d)->brush());
|
||||
}
|
||||
}
|
||||
|
||||
PRESERVE_PATH(d, preserve);
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.qt4", QT_INTERFACE_VERSION, &QT);
|
||||
DRAW_init();
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -129,6 +129,7 @@ GB_CLASS CLASS_Control;
|
||||
GB_CLASS CLASS_Container;
|
||||
GB_CLASS CLASS_UserControl;
|
||||
GB_CLASS CLASS_UserContainer;
|
||||
GB_CLASS CLASS_TabStrip;
|
||||
GB_CLASS CLASS_Window;
|
||||
GB_CLASS CLASS_Menu;
|
||||
GB_CLASS CLASS_Picture;
|
||||
@ -1025,6 +1026,7 @@ int EXPORT GB_INIT(void)
|
||||
CLASS_Container = GB.FindClass("Container");
|
||||
CLASS_UserControl = GB.FindClass("UserControl");
|
||||
CLASS_UserContainer = GB.FindClass("UserContainer");
|
||||
CLASS_TabStrip = GB.FindClass("TabStrip");
|
||||
CLASS_Window = GB.FindClass("Window");
|
||||
CLASS_Menu = GB.FindClass("Menu");
|
||||
CLASS_Picture = GB.FindClass("Picture");
|
||||
@ -1037,7 +1039,7 @@ int EXPORT GB_INIT(void)
|
||||
|
||||
QT_InitEventLoop();
|
||||
|
||||
return TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -49,6 +49,7 @@ extern GB_CLASS CLASS_Control;
|
||||
extern GB_CLASS CLASS_Container;
|
||||
extern GB_CLASS CLASS_UserControl;
|
||||
extern GB_CLASS CLASS_UserContainer;
|
||||
extern GB_CLASS CLASS_TabStrip;
|
||||
extern GB_CLASS CLASS_Window;
|
||||
extern GB_CLASS CLASS_Menu;
|
||||
extern GB_CLASS CLASS_Picture;
|
||||
|
@ -43,7 +43,7 @@ int EXPORT GB_INIT(void)
|
||||
GB.GetInterface("gb.qt4", QT_INTERFACE_VERSION, &QT);
|
||||
GB.GetInterface("gb.opengl", GL_INTERFACE_VERSION, &GL);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -362,6 +362,7 @@ GB_DESC CWebViewDesc[] =
|
||||
|
||||
MyWebView::MyWebView(QWidget *parent) : QWebView(parent)
|
||||
{
|
||||
//settings()->setFontFamily(QWebSettings::FixedFont, "monospace");
|
||||
}
|
||||
|
||||
QWebView *MyWebView::createWindow(QWebPage::WebWindowType type)
|
||||
|
@ -54,7 +54,7 @@ GB_DESC *GB_CLASSES[] EXPORT =
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
GB.GetInterface("gb.qt4", QT_INTERFACE_VERSION, &QT);
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -74,7 +74,7 @@ int EXPORT GB_INIT(void)
|
||||
|
||||
SOUND_init();
|
||||
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ extern "C"
|
||||
CLASS_Image = GB.FindClass("Image");
|
||||
CLASS_Font = GB.FindClass("Font");
|
||||
|
||||
return true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -58,7 +58,7 @@ GB_DESC *GB_CLASSES[] EXPORT =
|
||||
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -32,16 +32,14 @@ GB_INTERFACE GB EXPORT;
|
||||
|
||||
GB_DESC *GB_CLASSES[] EXPORT =
|
||||
{
|
||||
|
||||
CXsltDesc,
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -54,7 +54,7 @@
|
||||
#include "gbx_component.h"
|
||||
|
||||
|
||||
/*#define DEBUG*/
|
||||
//#define DEBUG_COMP
|
||||
/*#define DEBUG_PRELOAD*/
|
||||
|
||||
COMPONENT *COMPONENT_current = NULL;
|
||||
@ -76,9 +76,29 @@ void COMPONENT_init(void)
|
||||
void COMPONENT_exit(void)
|
||||
{
|
||||
COMPONENT *comp;
|
||||
int order;
|
||||
int max_order = 0;
|
||||
|
||||
LIST_for_each(comp, _component_list)
|
||||
{
|
||||
if (comp->order > max_order)
|
||||
max_order = comp->order;
|
||||
}
|
||||
|
||||
for (order = 0; order <= max_order; order++)
|
||||
{
|
||||
LIST_for_each(comp, _component_list)
|
||||
{
|
||||
if (comp->order == order)
|
||||
COMPONENT_unload(comp);
|
||||
}
|
||||
}
|
||||
|
||||
LIST_for_each(comp, _component_list)
|
||||
{
|
||||
if (comp->loaded)
|
||||
COMPONENT_unload(comp);
|
||||
}
|
||||
|
||||
while (_component_list)
|
||||
COMPONENT_delete(_component_list);
|
||||
@ -245,7 +265,7 @@ void COMPONENT_load(COMPONENT *comp)
|
||||
COMPONENT_current = comp;
|
||||
|
||||
if (comp->library)
|
||||
LIBRARY_load(comp->library);
|
||||
comp->order = LIBRARY_load(comp->library);
|
||||
if (comp->archive)
|
||||
ARCHIVE_load(comp->archive);
|
||||
|
||||
@ -256,12 +276,21 @@ void COMPONENT_load(COMPONENT *comp)
|
||||
|
||||
void COMPONENT_unload(COMPONENT *comp)
|
||||
{
|
||||
if (!comp->loaded)
|
||||
return;
|
||||
|
||||
#if DEBUG_COMP
|
||||
fprintf(stderr, "Unloading component %s [%d]\n", comp->name, comp->order);
|
||||
#endif
|
||||
|
||||
if (comp->library)
|
||||
LIBRARY_unload(comp->library);
|
||||
|
||||
/* Do not exist yet */
|
||||
//if (comp->archive)
|
||||
// ARCHIVE_unload(comp->archive);
|
||||
|
||||
comp->loaded = FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,11 +38,12 @@ typedef
|
||||
char *name;
|
||||
LIBRARY *library;
|
||||
ARCHIVE *archive;
|
||||
char order;
|
||||
unsigned preload : 1;
|
||||
unsigned loaded : 1;
|
||||
unsigned user : 1;
|
||||
unsigned warning : 1; // Set when the bytecode warning was displayed by the class loader for this component
|
||||
unsigned _reserved : 28;
|
||||
unsigned _reserved : 20;
|
||||
}
|
||||
PACKED
|
||||
COMPONENT;
|
||||
|
@ -438,15 +438,16 @@ void LIBRARY_delete(LIBRARY *lib)
|
||||
}
|
||||
|
||||
|
||||
void LIBRARY_load(LIBRARY *lib)
|
||||
int LIBRARY_load(LIBRARY *lib)
|
||||
{
|
||||
int (*func)();
|
||||
void **iface;
|
||||
GB_DESC **desc;
|
||||
char *path;
|
||||
int order = 0;
|
||||
|
||||
if (lib->handle)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
clock_t t = clock();
|
||||
@ -489,7 +490,8 @@ void LIBRARY_load(LIBRARY *lib)
|
||||
lib->info = (int(*)())get_symbol(lib, LIB_INFO, FALSE);
|
||||
|
||||
/* Initialisation */
|
||||
lib->persistent = (bool)(*func)();
|
||||
order = (*func)();
|
||||
lib->persistent = order < 0;
|
||||
|
||||
/* Déclaration des classes */
|
||||
desc = get_symbol(lib, LIB_CLASS, FALSE);
|
||||
@ -500,6 +502,8 @@ void LIBRARY_load(LIBRARY *lib)
|
||||
fprintf(stderr, "Library %s loaded ", lib->name);
|
||||
fprintf(stderr, "in %g s\n", ((double)(clock() - t) / CLOCKS_PER_SEC));
|
||||
#endif
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ void LIBRARY_exit(void);
|
||||
LIBRARY *LIBRARY_create(const char *path);
|
||||
void LIBRARY_delete(LIBRARY *lib);
|
||||
|
||||
void LIBRARY_load(LIBRARY *lib);
|
||||
int LIBRARY_load(LIBRARY *lib);
|
||||
void LIBRARY_unload(LIBRARY *lib);
|
||||
|
||||
void LIBRARY_declare(GB_DESC **desc);
|
||||
|
@ -54,7 +54,7 @@ void *GB_DEBUG_1[] EXPORT =
|
||||
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -694,7 +694,7 @@ BEGIN_METHOD(Paint_Image, GB_OBJECT image; GB_FLOAT x; GB_FLOAT y)
|
||||
{
|
||||
GB_TRANSFORM transform;
|
||||
PAINT->Transform.Create(&transform);
|
||||
PAINT->Transform.Translate(transform, -VARGOPT(x, 0.0), -VARGOPT(y, 0.0));
|
||||
PAINT->Transform.Translate(transform, VARGOPT(x, 0.0), VARGOPT(y, 0.0));
|
||||
PAINT->Brush.Matrix(brush, TRUE, transform);
|
||||
PAINT->Transform.Delete(&transform);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ int EXPORT GB_INIT(void)
|
||||
{
|
||||
EVAL_init();
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -64,7 +64,7 @@ int EXPORT GB_INIT(void)
|
||||
if (GB.LoadComponent(comp))
|
||||
fprintf(stderr, "gb.gui: unable to load '%s' component\n", comp);
|
||||
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
@ -71,7 +71,7 @@ void *GB_IMAGE_1[] EXPORT =
|
||||
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
|
Loading…
x
Reference in New Issue
Block a user