[INTERPRETER]

* OPT: Using object references is faster.
* BUG: Fix a misuse of GB.NewString() in the String class.

[COMPILER]
* BUG: Raise an error now when trying to create an array of structures.

[GB.QT4]
* OPT: Global widget event filter is faster.
* OPT: Do not internallt relayout TabStrip too often, because Qt takes a 
  lot of time to do that.



git-svn-id: svn://localhost/gambas/trunk@2974 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2010-05-28 06:24:14 +00:00
parent 74f930e0b6
commit b727d17086
28 changed files with 6247 additions and 5873 deletions

View File

@ -307,23 +307,23 @@ msgstr ""
msgid "Gambas reports"
msgstr ""
#: CRecentFile.class:46
#: CRecentFile.class:48
msgid "Today"
msgstr ""
#: CRecentFile.class:48
#: CRecentFile.class:50
msgid "Yesterday"
msgstr ""
#: CRecentFile.class:50
#: CRecentFile.class:52
msgid "Two days ago"
msgstr ""
#: CRecentFile.class:52
#: CRecentFile.class:54
msgid "This week"
msgstr ""
#: CRecentFile.class:54
#: CRecentFile.class:56
msgid "This month"
msgstr ""
@ -354,7 +354,7 @@ msgstr ""
#: Design.module:381 FColorChooser.class:201 FCommit.class:380
#: FConnectionEditor.class:411 FCreateFile.class:923 FFontChooser.class:79
#: FGotoLine.class:57 FList.class:331 FMain.class:2925
#: FGotoLine.class:57 FList.class:331 FMain.class:2929
#: FMakeExecutable.class:138 FMenu.class:1065 FNewConnection.class:573
#: FNewTable.class:159 FNewTranslation.class:64 FOpenProject.class:458
#: FPasteSpecial.class:273 FPropertyProject.class:258
@ -419,7 +419,7 @@ msgstr ""
msgid "System information"
msgstr ""
#: FAbout.class:595 FList.class:308 FMain.class:2420
#: FAbout.class:595 FList.class:308 FMain.class:2424
msgid "&Copy"
msgstr ""
@ -555,7 +555,7 @@ msgid ""
"You must resolve the conflict in order to use the file."
msgstr ""
#: FConflict.class:25 FMain.class:2393
#: FConflict.class:25 FMain.class:2397
msgid "&Edit"
msgstr ""
@ -824,7 +824,7 @@ msgstr ""
msgid "Fields"
msgstr ""
#: FConnectionEditor.class:1681 FMain.class:1692
#: FConnectionEditor.class:1681 FMain.class:1696
msgid "Add"
msgstr ""
@ -888,7 +888,7 @@ msgstr ""
msgid "New file"
msgstr ""
#: FCreateFile.class:582 FMain.class:2298
#: FCreateFile.class:582 FMain.class:2302
msgid "New"
msgstr ""
@ -977,7 +977,7 @@ msgstr ""
msgid "The project has been successfully created."
msgstr ""
#: FCreateProject.class:337 FMain.class:2531
#: FCreateProject.class:337 FMain.class:2535
msgid "New project"
msgstr ""
@ -1134,11 +1134,11 @@ msgstr ""
msgid "Dynamic variables"
msgstr ""
#: FDebugInfo.class:969 FMain.class:2817
#: FDebugInfo.class:969 FMain.class:2821
msgid "Debug"
msgstr ""
#: FDebugInfo.class:982 FMain.class:2657 FOption.class:1419 FSearch.class:84
#: FDebugInfo.class:982 FMain.class:2661 FOption.class:1419 FSearch.class:84
msgid "Console"
msgstr ""
@ -1178,7 +1178,7 @@ msgstr ""
msgid "Remove current expression"
msgstr ""
#: FDebugInfo.class:1081 FMain.class:2498 FMakeInstall.class:1545
#: FDebugInfo.class:1081 FMain.class:2502 FMakeInstall.class:1545
#: FOption.class:1521 FPropertyProject.class:1841
msgid "&Remove"
msgstr ""
@ -1238,7 +1238,7 @@ msgstr ""
msgid "Open form"
msgstr ""
#: FEditor.class:3298 FForm.class:3463 FMain.class:2460
#: FEditor.class:3298 FForm.class:3463 FMain.class:2464
msgid "&Startup class"
msgstr ""
@ -1517,7 +1517,7 @@ msgstr ""
msgid "Move tab last"
msgstr ""
#: FFormStack.class:293 FMain.class:2845
#: FFormStack.class:293 FMain.class:2849
msgid "Hierarchy"
msgstr ""
@ -1927,7 +1927,7 @@ msgstr ""
msgid "Cl&ear"
msgstr ""
#: FList.class:314 FMain.class:2427
#: FList.class:314 FMain.class:2431
msgid "&Paste"
msgstr ""
@ -1987,415 +1987,415 @@ msgstr ""
msgid "Clean"
msgstr ""
#: FMain.class:1692
#: FMain.class:1696
msgid "Do you really want to add this file to the repository?"
msgstr ""
#: FMain.class:1921
#: FMain.class:1925
msgid "&File"
msgstr ""
#: FMain.class:1925
#: FMain.class:1929
msgid "&New project..."
msgstr ""
#: FMain.class:1932
#: FMain.class:1936
msgid "&Open project..."
msgstr ""
#: FMain.class:1938
#: FMain.class:1942
msgid "Open &recent"
msgstr ""
#: FMain.class:1945
#: FMain.class:1949
msgid "Open &example"
msgstr ""
#: FMain.class:1956
#: FMain.class:1960
msgid "&Save project"
msgstr ""
#: FMain.class:1963
#: FMain.class:1967
msgid "Save project &as..."
msgstr ""
#: FMain.class:1973
#: FMain.class:1977
msgid "&Quit"
msgstr ""
#: FMain.class:1980
#: FMain.class:1984
msgid "&Project"
msgstr ""
#: FMain.class:1984
#: FMain.class:1988
msgid "&Compile"
msgstr ""
#: FMain.class:1991
#: FMain.class:1995
msgid "Compile &All"
msgstr ""
#: FMain.class:2001
#: FMain.class:2005
msgid "&Translate..."
msgstr ""
#: FMain.class:2010
#: FMain.class:2014
msgid "Make"
msgstr ""
#: FMain.class:2014
#: FMain.class:2018
msgid "E&xecutable..."
msgstr ""
#: FMain.class:2021
#: FMain.class:2025
msgid "&Source archive..."
msgstr ""
#: FMain.class:2028
#: FMain.class:2032
msgid "&Installation package..."
msgstr ""
#: FMain.class:2039
#: FMain.class:2043
msgid "&Clean up"
msgstr ""
#: FMain.class:2045 FSearch.class:964
#: FMain.class:2049 FSearch.class:964
msgid "&Refresh"
msgstr ""
#: FMain.class:2051
#: FMain.class:2055
msgid "Put on &version control"
msgstr ""
#: FMain.class:2061
#: FMain.class:2065
msgid "&Properties..."
msgstr ""
#: FMain.class:2068
#: FMain.class:2072
msgid "&Debug"
msgstr ""
#: FMain.class:2072
#: FMain.class:2076
msgid "&Run"
msgstr ""
#: FMain.class:2082
#: FMain.class:2086
msgid "&Pause"
msgstr ""
#: FMain.class:2089
#: FMain.class:2093
msgid "&Stop"
msgstr ""
#: FMain.class:2096
#: FMain.class:2100
msgid "St&ep"
msgstr ""
#: FMain.class:2103
#: FMain.class:2107
msgid "&Forward"
msgstr ""
#: FMain.class:2110
#: FMain.class:2114
msgid "Finis&h"
msgstr ""
#: FMain.class:2117
#: FMain.class:2121
msgid "Run &until"
msgstr ""
#: FMain.class:2127
#: FMain.class:2131
msgid "&Toggle breakpoint"
msgstr ""
#: FMain.class:2135
#: FMain.class:2139
msgid "Clear &all breakpoints"
msgstr ""
#: FMain.class:2143
#: FMain.class:2147
msgid "&Watch expression"
msgstr ""
#: FMain.class:2149
#: FMain.class:2153
msgid "Close all &debug windows"
msgstr ""
#: FMain.class:2154
#: FMain.class:2158
msgid "&View"
msgstr ""
#: FMain.class:2158
#: FMain.class:2162
msgid "Pro&ject"
msgstr ""
#: FMain.class:2167
#: FMain.class:2171
msgid "&Properties"
msgstr ""
#: FMain.class:2175
#: FMain.class:2179
msgid "&Toolbox"
msgstr ""
#: FMain.class:2183
#: FMain.class:2187
msgid "&Console"
msgstr ""
#: FMain.class:2193
#: FMain.class:2197
msgid "Status bar"
msgstr ""
#: FMain.class:2200
#: FMain.class:2204
msgid "Hide menubar"
msgstr ""
#: FMain.class:2206
#: FMain.class:2210
msgid "Close &all windows"
msgstr ""
#: FMain.class:2212
#: FMain.class:2216
msgid "&Tools"
msgstr ""
#: FMain.class:2215
#: FMain.class:2219
msgid "&Find..."
msgstr ""
#: FMain.class:2221
#: FMain.class:2225
msgid "&Replace..."
msgstr ""
#: FMain.class:2231
#: FMain.class:2235
msgid "&Browse project..."
msgstr ""
#: FMain.class:2238
#: FMain.class:2242
msgid "&Open a terminal..."
msgstr ""
#: FMain.class:2245
#: FMain.class:2249
msgid "&Update all forms"
msgstr ""
#: FMain.class:2254
#: FMain.class:2258
msgid "&Shortcuts..."
msgstr ""
#: FMain.class:2260
#: FMain.class:2264
msgid "&Preferences..."
msgstr ""
#: FMain.class:2268
#: FMain.class:2272
msgid "&?"
msgstr ""
#: FMain.class:2272
#: FMain.class:2276
msgid "&Help browser"
msgstr ""
#: FMain.class:2280
#: FMain.class:2284
msgid "&Tips of the day"
msgstr ""
#: FMain.class:2289
#: FMain.class:2293
msgid "&About Gambas..."
msgstr ""
#: FMain.class:2302
#: FMain.class:2306
msgid "&Directory"
msgstr ""
#: FMain.class:2308
#: FMain.class:2312
msgid "&Project link..."
msgstr ""
#: FMain.class:2318
#: FMain.class:2322
msgid "&Module..."
msgstr ""
#: FMain.class:2326
#: FMain.class:2330
msgid "&Class..."
msgstr ""
#: FMain.class:2334
#: FMain.class:2338
msgid "&Form..."
msgstr ""
#: FMain.class:2342
#: FMain.class:2346
msgid "&WebPage..."
msgstr ""
#: FMain.class:2350
#: FMain.class:2354
msgid "&Report..."
msgstr ""
#: FMain.class:2361
#: FMain.class:2365
msgid "&Image..."
msgstr ""
#: FMain.class:2368
#: FMain.class:2372
msgid "&HTML file..."
msgstr ""
#: FMain.class:2375
#: FMain.class:2379
msgid "&Style sheet..."
msgstr ""
#: FMain.class:2383
#: FMain.class:2387
msgid "&Other..."
msgstr ""
#: FMain.class:2398
#: FMain.class:2402
msgid "Edit &code"
msgstr ""
#: FMain.class:2402
#: FMain.class:2406
msgid "Edit with"
msgstr ""
#: FMain.class:2413
#: FMain.class:2417
msgid "&Cut"
msgstr ""
#: FMain.class:2434
#: FMain.class:2438
msgid "&Rename..."
msgstr ""
#: FMain.class:2441
#: FMain.class:2445
msgid "&Delete..."
msgstr ""
#: FMain.class:2451
#: FMain.class:2455
msgid "Copy file pat&h"
msgstr ""
#: FMain.class:2468
#: FMain.class:2472
msgid "&Add to repository"
msgstr ""
#: FMain.class:2484
#: FMain.class:2488
msgid "&New connection..."
msgstr ""
#: FMain.class:2492
#: FMain.class:2496
msgid "&Open"
msgstr ""
#: FMain.class:2538
#: FMain.class:2542
msgid "Open project"
msgstr ""
#: FMain.class:2545
#: FMain.class:2549
msgid "Save project"
msgstr ""
#: FMain.class:2552 Project.module:2018
#: FMain.class:2556 Project.module:2018
msgid "Save project as"
msgstr ""
#: FMain.class:2559 FPropertyProject.class:54
#: FMain.class:2563 FPropertyProject.class:54
msgid "Project properties"
msgstr ""
#: FMain.class:2567
#: FMain.class:2571
msgid "Refresh project"
msgstr ""
#: FMain.class:2574 FOption.class:879
#: FMain.class:2578 FOption.class:879
msgid "Preferences"
msgstr ""
#: FMain.class:2583
#: FMain.class:2587
msgid "Shortcuts"
msgstr ""
#: FMain.class:2594
#: FMain.class:2598
msgid "Translate"
msgstr ""
#: FMain.class:2602
#: FMain.class:2606
msgid "Make source archive"
msgstr ""
#: FMain.class:2609 FMakeExecutable.class:83
#: FMain.class:2613 FMakeExecutable.class:83
msgid "Make executable"
msgstr ""
#: FMain.class:2617 FMakeInstall.class:1168
#: FMain.class:2621 FMakeInstall.class:1168
msgid "Make installation package"
msgstr ""
#: FMain.class:2629 FSearch.class:88 FSelectIcon.class:216 Project.module:1301
#: FMain.class:2633 FSearch.class:88 FSelectIcon.class:216 Project.module:1301
msgid "Project"
msgstr ""
#: FMain.class:2639
#: FMain.class:2643
msgid "Properties sheet"
msgstr ""
#: FMain.class:2648
#: FMain.class:2652
msgid "Toolbox"
msgstr ""
#: FMain.class:2665
#: FMain.class:2669
msgid "Compile"
msgstr ""
#: FMain.class:2672
#: FMain.class:2676
msgid "Compile all"
msgstr ""
#: FMain.class:2679
#: FMain.class:2683
msgid "Run"
msgstr ""
#: FMain.class:2686
#: FMain.class:2690
msgid "Pause"
msgstr ""
#: FMain.class:2693
#: FMain.class:2697
msgid "Stop"
msgstr ""
#: FMain.class:2700
#: FMain.class:2704
msgid "Step"
msgstr ""
#: FMain.class:2707
#: FMain.class:2711
msgid "Forward"
msgstr ""
#: FMain.class:2714
#: FMain.class:2718
msgid "Finish current function"
msgstr ""
#: FMain.class:2722
#: FMain.class:2726
msgid "Run until current line"
msgstr ""
#: FMain.class:2730
#: FMain.class:2734
msgid "Watch expression"
msgstr ""
#: FMain.class:2737
#: FMain.class:2741
msgid "Toggle breakpoint"
msgstr ""
#: FMain.class:2749
#: FMain.class:2753
msgid "Search string"
msgstr ""
#: FMain.class:2755
#: FMain.class:2759
msgid "Search in project"
msgstr ""
#: FMain.class:2762
#: FMain.class:2766
msgid "Search & replace"
msgstr ""
#: FMain.class:2774
#: FMain.class:2778
msgid "Show menu bar"
msgstr ""
#: FMain.class:2826 FProperty.class:1146
#: FMain.class:2830 FProperty.class:1146
msgid "Properties"
msgstr ""

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,8 @@
Static Public All As New CRecentFile[]
Static Public SortByDate As Boolean
Static Private $bLoaded As Boolean
Public Const MAX_RECENT As Integer = 64
Public Path As String
@ -88,6 +90,8 @@ Static Public Sub Load()
Endif
Endif
Next
$bLoaded = True
End
@ -116,6 +120,8 @@ Static Public Sub Add(sPath As String)
Dim iInd As Integer
Dim nMax As Integer
Dim hRecentFile As CRecentFile
If Not $bLoaded Then Return
If Right$(sPath) = "/" Then sPath = Left$(sPath, -1)

View File

@ -1597,7 +1597,11 @@ End
Public Sub mnuTerminal_Click()
Desktop.OpenTerminal(Project.Dir)
If Desktop.Type = "KDE4" Then
Exec ["konsole", "--workdir", Project.Dir, "--notransparency"]
Else
Desktop.OpenTerminal(Project.Dir)
Endif
End

View File

@ -13,7 +13,7 @@ SearchString=True
[OpenFile]
Active=1
File[1]="/home/benoit/gambas/3.0/trunk/gb.desktop/src/gb.desktop/.src/Desktop.class:0.0"
File[1]="/home/benoit/gambas/3.0/trunk/gb.desktop/src/gb.desktop/.src/Desktop.class:211.52"
File[2]="/home/benoit/gambas/3.0/trunk/gb.desktop/src/gb.desktop/.src/Main.module:29.7"
File[3]="/home/benoit/gambas/3.0/trunk/gb.desktop/src/gb.desktop/.src/_DesktopPasswords.class:66.42"
File[4]="/home/benoit/gambas/3.0/trunk/gb.desktop/src/gb.desktop/.src/Form1.form"

View File

@ -195,6 +195,7 @@ void CTab::updateText()
MyTabWidget::MyTabWidget(QWidget *parent) : QTabWidget(parent)
{
_oldw = _oldh = 0;
//tabBar()->installEventFilter(this);
}
@ -228,13 +229,20 @@ void MyTabWidget::layoutContainer()
#else
QStyleOptionTabWidgetFrame option;
#endif
initStyleOption(&option);
QRect contentsRect = style()->subElementRect(QStyle::SE_TabWidgetTabContents, &option, this);
QWidget *w = findChild<QStackedWidget *>();
QRect contentsRect;
if (_oldw != width() || _oldh != height())
{
initStyleOption(&option);
contentsRect = style()->subElementRect(QStyle::SE_TabWidgetTabContents, &option, this);
_oldw = width();
_oldh = height();
w->setGeometry(contentsRect);
}
else
contentsRect = w->geometry();
w->setGeometry(contentsRect);
if (THIS->container)
THIS->container->setGeometry(0, 0, contentsRect.width(), contentsRect.height());
}

View File

@ -80,6 +80,9 @@ public:
virtual ~MyTabWidget();
virtual void setEnabled(bool e);
void layoutContainer();
private:
int _oldw, _oldh;
};
class CTabStrip : public QObject

View File

@ -1885,10 +1885,58 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
bool original;
bool cancel;
QPoint p;
void *jump;
//if (widget->isA("MyMainWindow"))
// getDesignDebug(widget);
switch (type)
{
case QEvent::Enter:
jump = &&__ENTER; break;
case QEvent::Leave:
jump = &&__LEAVE; break;
case QEvent::FocusIn:
jump = &&__FOCUS_IN; break;
case QEvent::FocusOut:
jump = &&__FOCUS_OUT; break;
case QEvent::ContextMenu:
jump = &&__CONTEXT_MENU; break;
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseMove:
jump = &&__MOUSE; break;
case QEvent::MouseButtonDblClick:
jump = &&__DBL_CLICK; break;
case QEvent::KeyPress:
case QEvent::KeyRelease:
jump = &&__KEY; break;
case QEvent::InputMethod:
jump = &&__INPUT_METHOD; break;
case QEvent::Wheel:
jump = &&__MOUSE_WHEEL; break;
case QEvent::DragEnter:
jump = &&__DRAG_ENTER; break;
case QEvent::DragMove:
jump = &&__DRAG_MOVE; break;
case QEvent::Drop:
jump = &&__DROP; break;
case QEvent::DragLeave:
jump = &&__DRAG_LEAVE; break;
case QEvent::Shortcut:
jump = &&_DESIGN; break;
case QEvent::DeferredDelete:
control = CWidget::getDesign(widget);
if (!control || CWIDGET_test_flag(control, WF_DELETED))
{
QObject::eventFilter(widget, event);
return false;
}
else
goto _STANDARD;
default:
goto _STANDARD;
}
control = CWidget::getDesign(widget);
//for(;;)
//{
@ -1902,6 +1950,8 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
real = CWidget::real;
design = CWIDGET_test_flag(control, WF_DESIGN); // && !GB.Is(control, CLASS_Container);
original = event->spontaneous();
goto *jump;
/*if (type != QEvent::Enter)
{
@ -1915,30 +1965,38 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
}
}*/
if (type == QEvent::Enter)
__ENTER:
{
if (real && !qApp->activePopupWidget())
GB.Raise(control, EVENT_Enter, 0);
goto __NEXT;
}
else if (type == QEvent::Leave)
__LEAVE:
{
if (real && !qApp->activePopupWidget())
GB.Raise(control, EVENT_Leave, 0);
goto __NEXT;
}
else if (type == QEvent::FocusIn)
__FOCUS_IN:
{
//qDebug("FocusIn: %p %s (%p)", control, control->name, CWIDGET_active_control);
CWIDGET_active_control = control;
handle_focus_change();
CWINDOW_activate(control);
goto __NEXT;
}
else if (type == QEvent::FocusOut)
__FOCUS_OUT:
{
//qDebug("FocusOut: %p %s (%p)", control, control->name, CWIDGET_active_control);
CWIDGET_active_control = NULL;
handle_focus_change();
goto __NEXT;
}
else if (type == QEvent::ContextMenu)
__CONTEXT_MENU:
{
// if (real && GB.CanRaise(control, EVENT_Menu))
//qDebug("Menu event! %p %d", control, EVENT_Menu);
@ -1948,10 +2006,10 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
GB.Raise(control, EVENT_Menu, 0);
return true;
}
goto __NEXT;
}
else if ((type == QEvent::MouseButtonPress)
|| (type == QEvent::MouseButtonRelease)
|| (type == QEvent::MouseMove))
__MOUSE:
{
QMouseEvent *mevent = (QMouseEvent *)event;
@ -2065,8 +2123,11 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
if (cancel)
return true;
goto __NEXT;
}
else if (type == QEvent::MouseButtonDblClick)
__DBL_CLICK:
{
if (!original)
goto _DESIGN;
@ -2077,9 +2138,10 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
GB.Ref(control);
GB.Post((void (*)())post_dblclick_event, (intptr_t)control);
}
goto __NEXT;
}
else if ((type == QEvent::KeyPress)
|| (type == QEvent::KeyRelease))
__KEY:
{
QKeyEvent *kevent = (QKeyEvent *)event;
@ -2140,6 +2202,8 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
if (control->flag.grab && event_id == EVENT_KeyPress && kevent->key() == Qt::Key_Escape)
MyApplication::eventLoop->exit();
goto __NEXT;
/*_ACCEL:
if (event_id == EVENT_KeyPress && CWINDOW_Main && ((QWidget *)widget)->isWindow())
@ -2158,7 +2222,8 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
}
}*/
}
else if (type == QEvent::InputMethod)
__INPUT_METHOD:
{
QInputMethodEvent *imevent = (QInputMethodEvent *)event;
@ -2194,8 +2259,11 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
return true;
}
}
goto __NEXT;
}
else if (type == QEvent::Wheel)
__MOUSE_WHEEL:
{
QWheelEvent *ev = (QWheelEvent *)event;
@ -2227,8 +2295,11 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
CMOUSE_clear(false);
}
goto __NEXT;
}
else if (type == QEvent::DragEnter)
__DRAG_ENTER:
{
//if (!CWIDGET_test_flag(control, WF_NO_DRAG))
if (CDRAG_drag_enter((QWidget *)widget, control, (QDropEvent *)event))
@ -2237,8 +2308,10 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
CDRAG_hide_frame(control);
return true;
}
goto __NEXT;
}
else if (type == QEvent::DragMove)
__DRAG_MOVE:
{
//if (!CWIDGET_test_flag(control, WF_NO_DRAG))
if (CDRAG_drag_move((QWidget *)widget, control, (QDropEvent *)event))
@ -2247,17 +2320,24 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
CDRAG_hide_frame(control);
return true;
}
goto __NEXT;
}
else if (type == QEvent::Drop)
__DROP:
{
//if (!CWIDGET_test_flag(control, WF_NO_DRAG))
CDRAG_drag_drop((QWidget *)widget, control, (QDropEvent *)event);
goto __NEXT;
}
else if (type == QEvent::DragLeave)
__DRAG_LEAVE:
{
CDRAG_hide_frame(control);
goto __NEXT;
}
__NEXT:
if (!control || CWIDGET_test_flag(control, WF_DELETED))
{
QObject::eventFilter(widget, event);

View File

@ -2478,7 +2478,7 @@ bool CWindow::eventFilter(QObject *o, QEvent *e)
{
CWINDOW *_object = (CWINDOW *)CWidget::get(o);
if (THIS != NULL)
if (THIS != NULL && ! CWIDGET_test_flag(THIS, WF_DELETED))
{
if (e->type() == QEvent::WindowActivate && e->spontaneous())
{

View File

@ -1,7 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 2.99.0 (r2637)
# Compiled with Gambas 2.99.0 (r2921)
Startup=FMain
Version=0.0.279
Version=0.0.280
Component=gb.image
Component=gb.qt4
TabSize=2

View File

@ -165,6 +165,7 @@ Static Public Sub Raise(Control As Object)
If $iGlobalLock Then Return
If Not Object.IsValid(Control) Then
Debug "warning: invalid control: "; Control
Error System.Backtrace.Join("\n")
Return
Endif

View File

@ -169,8 +169,10 @@ typedef
typedef
struct {
int index;
bool used;
bool exported;
unsigned used : 1;
unsigned exported : 1;
unsigned structure : 1;
unsigned _reserved : 29;
}
CLASS_REF;

View File

@ -815,6 +815,7 @@ static bool header_structure(void)
VARIABLE *field;
TRANS_DECL decl;
int nfield;
int index;
check_public_private(&look, &is_public);
@ -834,8 +835,10 @@ static bool header_structure(void)
nfield = 0;
structure->index = PATTERN_index(*JOB->current);
CLASS_add_class_exported(JOB->class, structure->index);
//TABLE_copy_symbol_with_prefix(JOB->class->table, structure->index, '.', NULL, &structure->index);
index = CLASS_add_class_exported(JOB->class, structure->index);
JOB->class->class[index].structure = TRUE; // Not used at the moment
//TABLE_copy_symbol_with_prefix(JOB->class->table, structure->index, '.', NULL, &structure->index);
JOB->current++;
TRANS_want_newline();

View File

@ -310,7 +310,7 @@ __END:
}
static PATTERN *trans_static_array(PATTERN *look, int mode, TRANS_DECL *result)
static PATTERN *trans_embedded_array(PATTERN *look, int mode, TRANS_DECL *result)
{
TRANS_NUMBER tnum;
int i;
@ -362,34 +362,37 @@ static PATTERN *trans_static_array(PATTERN *look, int mode, TRANS_DECL *result)
}
int TRANS_get_class(PATTERN pattern)
static int TRANS_get_class(PATTERN pattern, bool array)
{
int index = PATTERN_index(pattern);
int index_array;
if (!CLASS_exist_class(JOB->class, index))
{
// Maybe a compound class?
CLASS_SYMBOL *sym = CLASS_get_symbol(JOB->class, index);
int i;
char c;
//fprintf(stderr, "TRANS_get_class: %.*s\n", sym->symbol.len, sym->symbol.name);
for (i = sym->symbol.len - 1; i >= 0; i--)
if (array)
{
c = sym->symbol.name[i];
if (c == '[')
// Maybe a compound class?
CLASS_SYMBOL *sym = CLASS_get_symbol(JOB->class, index);
int i;
char c;
//fprintf(stderr, "TRANS_get_class: %.*s\n", sym->symbol.len, sym->symbol.name);
for (i = sym->symbol.len - 1; i >= 0; i--)
{
//fprintf(stderr, "TRANS_get_class: find %.*s\n", i, sym->symbol.name);
if (TABLE_find_symbol(JOB->class->table, sym->symbol.name, i, &index_array))
{
index_array = TRANS_get_class(PATTERN_make(RT_CLASS, index_array));
if (JOB->class->class[index_array].exported)
return CLASS_add_class_exported(JOB->class, index);
else
return CLASS_add_class(JOB->class, index);
c = sym->symbol.name[i];
if (c == '[')
{
//fprintf(stderr, "TRANS_get_class: find %.*s\n", i, sym->symbol.name);
if (TABLE_find_symbol(JOB->class->table, sym->symbol.name, i, &index_array))
{
index_array = TRANS_get_class(PATTERN_make(RT_CLASS, index_array), TRUE);
if (JOB->class->class[index_array].exported)
return CLASS_add_class_exported(JOB->class, index);
else
return CLASS_add_class(JOB->class, index);
}
}
}
}
@ -415,7 +418,7 @@ bool TRANS_type(int mode, TRANS_DECL *result)
result->init = NULL;
result->array.ndim = 0;
look = trans_static_array(look, mode, result);
look = trans_embedded_array(look, mode, result);
if (!PATTERN_is(*look, RS_AS))
{
@ -432,7 +435,7 @@ bool TRANS_type(int mode, TRANS_DECL *result)
if (PATTERN_is(*look, RS_NEW))
{
if (TYPE_get_id(result->type) == T_ARRAY)
THROW("Cannot mix NEW and static array declaration");
THROW("Cannot mix NEW and embedded array");
result->is_new = TRUE;
look++;
@ -443,13 +446,16 @@ bool TRANS_type(int mode, TRANS_DECL *result)
if ((mode & TT_CAN_STATIC) && PATTERN_is(*look, RS_STRUCT))
{
if (result->is_new)
THROW("Cannot mix NEW and static structure declaration");
THROW("Cannot mix NEW and embedded structure");
if (result->array.ndim > 0)
THROW("Cannot mix embedded array and embedded structure");
id = T_STRUCT;
look++;
if (!PATTERN_is_class(*look))
THROW_UNEXPECTED(look);
value = TRANS_get_class(*look);
value = TRANS_get_class(*look, FALSE);
look++;
}
else
@ -465,7 +471,7 @@ bool TRANS_type(int mode, TRANS_DECL *result)
else
{
id = T_OBJECT;
value = TRANS_get_class(*look);
value = TRANS_get_class(*look, TRUE);
}
if (PATTERN_is(look[1], RS_LSQR))

View File

@ -127,7 +127,7 @@ void TRANS_want(int reserved, char *msg);
void TRANS_want_newline(void);
bool TRANS_is(int reserved);
void TRANS_ignore(int reserved);
int TRANS_get_class(PATTERN pattern);
//int TRANS_get_class(PATTERN pattern);
bool TRANS_is_end_function(bool is_proc, PATTERN *look);
char *TRANS_get_num_desc(int num);

View File

@ -60,7 +60,7 @@ static void create_local_from_param()
for (i = 0; i < func->nparam; i++)
{
if (TYPE_get_id(func->param[i].type) != T_NULL)
if (TYPE_get_id(func->param[i].type) != T_VOID)
{
add_local(func->param[i].index, func->param[i].type, (i - func->nparam));
}

View File

@ -1017,7 +1017,7 @@ void TRANS_label(void)
if (label_info == NULL)
ARRAY_create(&label_info);
sym->local.type = TYPE_make(T_NULL, 0L, TK_LABEL);
sym->local.type = TYPE_make(T_VOID, 0L, TK_LABEL);
sym->local.value = ARRAY_count(label_info);
label = ARRAY_add(&label_info);

View File

@ -576,7 +576,7 @@ void TRANS_ignore_expression()
TYPE TRANS_variable_get_type()
{
TYPE type = TYPE_make(T_NULL, 0, 0);
TYPE type = TYPE_make(T_VOID, 0, 0);
TRANS_TREE *tree;
int count;
int index;

View File

@ -192,7 +192,10 @@ static void get_substring(int start, int len)
break;
}
GB_ReturnNewString(_str + pos, _pos - pos);
if (_pos > pos)
GB_ReturnNewString(_str + pos, _pos - pos);
else
GB_ReturnNull();
}
@ -272,7 +275,10 @@ static void convert_string(char *str, int len, bool upper)
__ERROR:
GB_ReturnNewString(str, len);
if (len > 0)
GB_ReturnNewString(str, len);
else
GB_ReturnNull();
}

View File

@ -1237,7 +1237,7 @@ void EXEC_native(void)
}
void EXEC_object(VALUE *val, CLASS **pclass, OBJECT **pobject, bool *pdefined)
bool EXEC_object(VALUE *val, CLASS **pclass, OBJECT **pobject)
{
static const void *jump[] = {
&&__ERROR, &&__ERROR, &&__ERROR, &&__ERROR, &&__ERROR, &&__ERROR, &&__ERROR, &&__ERROR, &&__ERROR,
@ -1368,7 +1368,8 @@ __RETURN:
*pclass = class;
*pobject = object;
*pdefined = defined;
return defined;
}

View File

@ -142,7 +142,7 @@ void EXEC_enter_quick(void);
void EXEC_leave(bool drop);
void EXEC_loop(void);
void EXEC_object(VALUE *SP, CLASS **pclass, OBJECT **pobject, bool *pdefined);
bool EXEC_object(VALUE *SP, CLASS **pclass, OBJECT **pobject);
void *EXEC_auto_create(CLASS *class, bool ref);
bool EXEC_call_native(void (*exec)(), void *object, TYPE type, VALUE *param);

View File

@ -33,14 +33,13 @@ void EXEC_enum_first(PCODE code)
{
OBJECT *object;
CLASS *class;
bool defined;
VALUE *local;
CENUM *old = EXEC_enum;
CENUM *cenum;
local = &BP[code & 0xFF];
EXEC_object(local, &class, &object, &defined);
EXEC_object(local, &class, &object);
if (!object && class->auto_create && !class->enum_static)
object = EXEC_auto_create(class, FALSE);
@ -72,7 +71,7 @@ bool EXEC_enum_next(PCODE code)
local = &BP[PC[-1] & 0xFF];
EXEC_object(local, &class, &object, &defined);
defined = EXEC_object(local, &class, &object);
cenum = (CENUM *)local[1]._object.object;
if (!cenum->stop)

View File

@ -903,10 +903,9 @@ _CALL:
if (UNLIKELY(!TYPE_is_function(val->type)))
{
bool defined;
EXEC_object(val, &EXEC.class, (OBJECT **)&EXEC.object, &defined);
val->type = T_FUNCTION;
bool defined = EXEC_object(val, &EXEC.class, (OBJECT **)&EXEC.object);
val->type = T_FUNCTION;
val->_function.kind = FUNCTION_CALL;
val->_function.defined = defined;
val->_function.class = EXEC.class;

View File

@ -53,7 +53,7 @@ void EXEC_pop_unknown(void)
bool defined;
VALUE *val;
EXEC_object(&SP[-1], &class, &object, &defined);
defined = EXEC_object(&SP[-1], &class, &object);
/*printf("> exec_pop_unknown: SP = %p -> %p\n", SP, SP->_string.addr);*/
@ -294,7 +294,7 @@ void EXEC_pop_array(ushort code)
__POP_GENERIC:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
// The first time we access a symbol, we must not be virtual to find it
if (LIKELY(defined && object && !VALUE_is_super(val)))
@ -319,7 +319,7 @@ __POP_GENERIC:
__POP_QUICK_ARRAY:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
TYPE type = ((CARRAY *)object)->type;
@ -352,7 +352,7 @@ __POP_QUICK_ARRAY:
__POP_QUICK_COLLECTION:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
VALUE_conv(&val[-1], T_VARIANT);
VALUE_conv_string(&val[1]);
@ -365,7 +365,7 @@ __POP_QUICK_COLLECTION:
__POP_ARRAY:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
__POP_ARRAY_2:

View File

@ -59,7 +59,7 @@ void EXEC_push_unknown(ushort code)
bool defined;
VALUE *val;
EXEC_object(&SP[-1], &class, &object, &defined);
defined = EXEC_object(&SP[-1], &class, &object);
goto *jump[code & 0xF];
@ -480,7 +480,7 @@ void EXEC_push_array(ushort code)
__PUSH_GENERIC:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
// The first time we access a symbol, we must not be virtual to find it
if (LIKELY(defined && object && !VALUE_is_super(val)))
@ -520,7 +520,7 @@ __PUSH_GENERIC:
__PUSH_QUICK_ARRAY:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
if (LIKELY(np == 1))
{
@ -543,7 +543,7 @@ __PUSH_QUICK_ARRAY:
__PUSH_QUICK_COLLECTION:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
VALUE_conv_string(&val[1]);
//fprintf(stderr, "GB_CollectionGet: %p '%.*s'\n", val[1]._string.addr, val[1]._string.len, val[1]._string.addr + val[1]._string.start);
@ -560,7 +560,7 @@ __PUSH_QUICK_END:
__PUSH_ARRAY:
EXEC_object(val, &class, &object, &defined);
defined = EXEC_object(val, &class, &object);
__PUSH_ARRAY_2:

View File

@ -57,7 +57,7 @@ enum {
T_VARIANT = 12,
T_ARRAY = 13,
T_STRUCT = 14,
T_NULL = 15,
//T_NULL = 15,
T_OBJECT = 16
};