From 2b432beca05efde3cf3e2e47cdb401f84712a4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 2 Jan 2011 18:24:50 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Error raised inside form generated code are correctly displayed again. [INTERPRETER] * NEW: The GB.Every() API now takes a pointer argument that will be passed to the callback. git-svn-id: svn://localhost/gambas/trunk@3430 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.lang/.pot | 12 ++++++------ app/src/gambas3/.src/Component/CPropertyInfo.class | 2 +- app/src/gambas3/.src/Debug/Design.module | 5 +++++ app/src/gambas3/.src/Editor/Code/FCompletion.class | 7 +++++-- app/src/gambas3/.src/Project.module | 4 ++-- main/gbx/gbx_c_timer.c | 5 +++-- main/gbx/gbx_c_timer.h | 2 +- main/share/gambas.h | 4 ++-- 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 84eb80374..69deb7165 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -370,11 +370,11 @@ msgid "" "the GNU General Public License." msgstr "" -#: Design.module:216 Project.module:1903 +#: Design.module:221 Project.module:1903 msgid "In class &1 at line &2." msgstr "" -#: Design.module:320 +#: Design.module:325 msgid "" "The program has stopped unexpectedly\n" "by raising signal #&1.\n" @@ -383,13 +383,13 @@ msgid "" "gambas@users.sourceforge.net." msgstr "" -#: Design.module:324 +#: Design.module:329 msgid "" "The program has returned\n" "the value: &1" msgstr "" -#: Design.module:382 FColorChooser.class:209 FCommit.class:380 +#: Design.module:387 FColorChooser.class:209 FCommit.class:380 #: FConnectionEditor.class:411 FCreateFile.class:922 FFontChooser.class:79 #: FGotoLine.class:57 FList.class:331 FMain.class:1677 FMenu.class:1238 #: FNewConnection.class:573 FNewTable.class:159 FNewTranslation.class:64 @@ -401,11 +401,11 @@ msgstr "" msgid "OK" msgstr "" -#: Design.module:772 +#: Design.module:777 msgid "Output terminal" msgstr "" -#: Design.module:799 +#: Design.module:804 msgid "No terminal emulator found." msgstr "" diff --git a/app/src/gambas3/.src/Component/CPropertyInfo.class b/app/src/gambas3/.src/Component/CPropertyInfo.class index 47b99c9d8..23306c79b 100644 --- a/app/src/gambas3/.src/Component/CPropertyInfo.class +++ b/app/src/gambas3/.src/Component/CPropertyInfo.class @@ -123,7 +123,7 @@ Public Sub _new(sComponent As String, sClass As String, sName As String, sKind A Dim sFirst As String Dim sArg As String - 'If sName = "Indent" Then Stop + 'If sClass == "ValInBox" And If sName = "Type" Then Stop Name = sName diff --git a/app/src/gambas3/.src/Debug/Design.module b/app/src/gambas3/.src/Debug/Design.module index 7796cbf99..77e527de1 100644 --- a/app/src/gambas3/.src/Debug/Design.module +++ b/app/src/gambas3/.src/Debug/Design.module @@ -54,10 +54,15 @@ End Public Sub CheckErrorMessage(hEditor As FEditor) + Dim sPath As String + If Not $sError Then Return If hEditor Then If hEditor.Name = $sPosClass And If hEditor.Editor.Line = ($iPosLine - 1) Then hEditor.ShowErrorMessage($sError, "error") + Else If $iPosLine > hEditor.Editor.Lines.Count Then + sPath = Project.FindForm(hEditor.Name) + FMain.ShowError($sError, sPath) Endif Else FMain.ShowError($sError) diff --git a/app/src/gambas3/.src/Editor/Code/FCompletion.class b/app/src/gambas3/.src/Editor/Code/FCompletion.class index 927dc690e..cc2f2bb24 100644 --- a/app/src/gambas3/.src/Editor/Code/FCompletion.class +++ b/app/src/gambas3/.src/Editor/Code/FCompletion.class @@ -301,9 +301,12 @@ Private Sub GetEvents(sCtrl As String) As String[] Dim sLine As String Dim aLine As String[] Dim iPos As Integer + Dim sPath As String - hForm = Project.FindForm(GetClass()) - If Not hForm Then Return + sPath = Project.FindForm(GetClass()) + If Not sPath Then Return + hForm = Project.LoadFile(sPath) + If Not hForm Then Return sCtrl = LCase(sCtrl) diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index 3aa724445..86b3bd587 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -1785,14 +1785,14 @@ Public Function ExistForm(sClass As String) As Boolean End -Public Sub FindForm(sClass As String) As FForm +Public Sub FindForm(sClass As String) As String Dim sFamily As String Dim sPath As String For Each sFamily In CFamily.List sPath = $cSourceDir[sClass & "." & sFamily] - If Exist(sPath) Then Return LoadFile(sPath) + If Exist(sPath) Then Return sPath Next End diff --git a/main/gbx/gbx_c_timer.c b/main/gbx/gbx_c_timer.c index 673ea1919..d0b13661f 100644 --- a/main/gbx/gbx_c_timer.c +++ b/main/gbx/gbx_c_timer.c @@ -44,7 +44,7 @@ static void enable_timer(CTIMER *_object, bool on) GB_Error("Too many active timers"); } -CTIMER *CTIMER_every(int delay, GB_TIMER_CALLBACK callback) +CTIMER *CTIMER_every(int delay, GB_TIMER_CALLBACK callback, intptr_t param) { CTIMER *timer; @@ -52,6 +52,7 @@ CTIMER *CTIMER_every(int delay, GB_TIMER_CALLBACK callback) OBJECT_REF(timer, "CTIMER_every"); timer->callback = callback; timer->delay = delay; + timer->tag = param; enable_timer(timer, TRUE); return timer; } @@ -60,7 +61,7 @@ void CTIMER_raise(void *_object) { if (THIS->callback) { - if (!(*(THIS->callback))()) + if (!(*(THIS->callback))(THIS->tag)) return; } else diff --git a/main/gbx/gbx_c_timer.h b/main/gbx/gbx_c_timer.h index eafa81a33..73991a592 100644 --- a/main/gbx/gbx_c_timer.h +++ b/main/gbx/gbx_c_timer.h @@ -39,6 +39,6 @@ extern GB_DESC NATIVE_Timer[]; #endif void CTIMER_raise(void *_object); -CTIMER *CTIMER_every(int delay, GB_TIMER_CALLBACK callback); +CTIMER *CTIMER_every(int delay, GB_TIMER_CALLBACK callback, intptr_t param); #endif diff --git a/main/share/gambas.h b/main/share/gambas.h index a5646cbad..f38628010 100644 --- a/main/share/gambas.h +++ b/main/share/gambas.h @@ -599,7 +599,7 @@ typedef /* Type of a timer callback */ typedef - int (*GB_TIMER_CALLBACK)(); + int (*GB_TIMER_CALLBACK)(intptr_t); /* Type of a posted function */ @@ -796,7 +796,7 @@ typedef int (*Loop)(int); void (*Post)(GB_CALLBACK, intptr_t); void (*Post2)(GB_CALLBACK, intptr_t, intptr_t); - GB_TIMER *(*Every)(int, GB_TIMER_CALLBACK); + GB_TIMER *(*Every)(int, GB_TIMER_CALLBACK, intptr_t); int (*Raise)(void *, int, int, ...); void (*RaiseLater)(void *, int); void (*CheckPost)(void);