[INTERPRETER]

* BUG: Do not search for Application_Error if the project startup class 
  has not be loaded yet.

[GB.GUI.BASE]
* NEW: Typing keys inside an IconView should not crash anymore.


git-svn-id: svn://localhost/gambas/trunk@5697 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2013-06-09 21:30:43 +00:00
parent fb673982d7
commit 70eca15fb4
6 changed files with 57 additions and 22 deletions

View file

@ -1,8 +1,8 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.4.0
# Compiled with Gambas 3.4.90
Title=gb.gui.base
Startup=FGridView
Version=3.4.0
Startup=FMain1
Version=3.4.90
VersionFile=1
Component=gb.image
Component=gb.gui

View file

@ -803,7 +803,7 @@ Public Sub ScrollArea_KeyPress()
End Select
If Len(Key.Text) >= 2 Or If Asc(Key.Text) >= 32 Or If Key.Code = Key.Backspace Then
If Len(Key.Text) >= 2 Or If Asc(Key.Text) >= 32 And IsAscii(Key.Text) Or If Key.Code = Key.Backspace Then
fNow = Timer
iStart = $iCurrent
@ -821,6 +821,7 @@ Public Sub ScrollArea_KeyPress()
iPos = iStart
For iInd = 0 To $aItems.Max
If iPos > $aItems.Max Then iPos = 0
With $aItems[iPos]
'Debug iInd;; .Text
If String.LCase(.Text) Begins $sFindItem Then
@ -829,7 +830,6 @@ Public Sub ScrollArea_KeyPress()
Endif
End With
Inc iPos
If iPos > $aItems.Max Then iPos = 0
Next
Endif

View file

@ -0,0 +1,11 @@
' Gambas class file
Public Sub Form_Open()
'add two items
Dim img As New Image(32, 32, Color.Yellow)
IconView1.Add("key1", "First Item", img.Picture)
IconView1.Add("key2", "last Item", img.Picture)
End

View file

@ -0,0 +1,21 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,91,60)
{ Label1 Label
MoveScaled(2,1,62,3)
Text = ("Select Last Item in the Icon View and press \"DEL\" Key on Keyboard,")
}
{ IconView1 IconView
MoveScaled(2,4,55,30)
}
{ PictureBox1 PictureBox
MoveScaled(46,37,44,22)
Picture = Picture["bug_screen_shot.jpg"]
Border = Border.Raised
}
{ Label2 Label
MoveScaled(5,44,34,3)
Text = ("IDE will Stop with the following Error")
}
}

View file

@ -1,8 +1,8 @@
FGridView
FMain1
gb.gui.base
0
0
3.4.0
3.4.90
gb.image
gb.gui

View file

@ -711,25 +711,28 @@ void ERROR_hook(void)
if (no_rec)
return;
handle_error = (CLASS_DESC_METHOD *)CLASS_get_symbol_desc_kind(PROJECT_class, "Application_Error", CD_STATIC_METHOD, 0);
if (handle_error)
if (PROJECT_class)
{
no_rec = TRUE;
ERROR_copy(&save, &last);
handle_error = (CLASS_DESC_METHOD *)CLASS_get_symbol_desc_kind(PROJECT_class, "Application_Error", CD_STATIC_METHOD, 0);
TRY
if (handle_error)
{
EXEC_public_desc(PROJECT_class, NULL, handle_error, 0);
}
CATCH
{
ERROR_save(&save, &last);
}
END_TRY
no_rec = TRUE;
ERROR_copy(&save, &last);
TRY
{
EXEC_public_desc(PROJECT_class, NULL, handle_error, 0);
}
CATCH
{
ERROR_save(&save, &last);
}
END_TRY
ERROR_restore(&save, &last);
no_rec = FALSE;
ERROR_restore(&save, &last);
no_rec = FALSE;
}
}
}