[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
This commit is contained in:
Benoît Minisini 2011-01-02 18:24:50 +00:00
parent 3ead02082c
commit 2b432beca0
8 changed files with 25 additions and 16 deletions

View file

@ -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 ""

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);