[DEVELOPMENT ENVIRONMENT]

* NEW: Project exported control icons are thiner.

[INTERPRETER]
* NEW: Release classes having an array class if that array class has no 
  instance.

[GB.GUI.BASE]
* NEW: _Gui._Quit is a new method called by the GUI components during their
  "quit" hook. At the moment it releases Drag.Icon picture and voids the 
  Picture cache.


git-svn-id: svn://localhost/gambas/trunk@7403 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-10-10 02:02:12 +00:00
parent 156ca6984b
commit 01a2b34270
8 changed files with 30 additions and 10 deletions

View file

@ -73,6 +73,7 @@ Static Public Sub GetIcon(sClass As String, sComp As String, Optional iSize As I
Dim I As Integer
Dim hClass As CClassInfo
Dim W As Integer
Dim F As Integer
Do
hClass = Project.Documentation.Classes[sComp &/ sClass]
@ -105,16 +106,18 @@ Static Public Sub GetIcon(sClass As String, sComp As String, Optional iSize As I
Paint.Begin(hImage)
Paint.Rectangle(0, 0, hImage.W - 1, hImage.H - 1, 2)
F = 4
Paint.Rectangle(0, F, hImage.W - 1, hImage.H - F * 2 - 1, 2)
Paint.Background = Color.White
Paint.Fill
Paint.Rectangle(0.5, 0.5, hImage.W - 1, hImage.H - 1, 2)
Paint.Rectangle(0.5, F + 0.5, hImage.W - 1, hImage.H - F * 2 - 1, 2)
Paint.Background = Color.Gray
Paint.LineWidth = 1
Paint.Stroke
Paint.Rectangle(3, 3, hImage.W - 6, hImage.H - 6)
Paint.Rectangle(3, 3 + F, hImage.W - 6, hImage.H - 6 - F * 2)
Paint.Clip
Paint.Font.Size = 7

View file

@ -1,7 +1,7 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,64,64)
MoveScaled(0,0,109,86)
{ Panel1 Panel
MoveScaled(5,8,56,40)
Font = Font["Monospace,Italic"]

View file

@ -2486,6 +2486,10 @@ _DefineShortcut
M
(hParent)Menu;
_Quit
M
#_IconView_Item
C

View file

@ -4,7 +4,7 @@ Export
Class Stock
Static $cCache As New Collection
Static Private $cCache As New Collection
Static Private $bInit As Boolean
Static Private $bDarkTheme As Boolean
@ -129,3 +129,4 @@ Static Public Sub _exit()
$cCache.Clear
End

View file

@ -56,6 +56,13 @@ Static Public Sub _DefineShortcut(hParent As Menu)
End
Static Public Sub _Quit()
Drag.Icon = Null
End
' Static Public Sub Menu_Hide()
'
' Dim hParent As Menu = Last

View file

@ -346,6 +346,9 @@ void my_quit (void)
GB.Call(&func, 0, FALSE);
}
if (!GB.GetFunction(&func, (void *)GB.FindClass("_Gui"), "_Quit", NULL, NULL))
GB.Call(&func, 0, FALSE);
CWINDOW_delete_all();
gControl::cleanRemovedControls();

View file

@ -1030,11 +1030,16 @@ static void hook_main(int *argc, char ***argv)
static void hook_quit()
{
GB_FUNCTION func;
CWINDOW_close_all(true);
CWINDOW_delete_all(true);
qApp->sendPostedEvents(); //processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::DeferredDeletion, 0);
qApp->sendPostedEvents(0, QEvent::DeferredDelete);
if (!GB.GetFunction(&func, (void *)GB.FindClass("_Gui"), "_Quit", NULL, NULL))
GB.Call(&func, 0, FALSE);
}

View file

@ -291,7 +291,7 @@ static void class_replace_global(CLASS *class)
static void release_class(CLASS *class)
{
#if DEBUG_LOAD
fprintf(stderr, "Freeing %s\n", class->name);
fprintf(stderr, "release_class: %s\n", class->name);
#endif
OBJECT_release(class, NULL);
class->exit = TRUE;
@ -365,9 +365,6 @@ void CLASS_clean_up(bool silent)
for (class = _classes; class; class = class->next)
{
/*if (!CLASS_is_native(class) && class->ready && !class->exit)
printf("%s: %d ready = %d\n", class->name, class->count, class->ready);*/
if (class->count == 0 && !CLASS_is_native(class) && CLASS_is_loaded(class) && !class->exit)
{
release_class(class);
@ -397,7 +394,7 @@ void CLASS_clean_up(bool silent)
for (class = _classes; class; class = class->next)
{
if (!CLASS_is_native(class) && CLASS_is_loaded(class) && !class->exit && (!class->array_class || class->array_class->exit)) // && !class->astruct_class)
if (!CLASS_is_native(class) && CLASS_is_loaded(class) && !class->exit && (!class->array_class || class->array_class->count == 0)) // && !class->astruct_class)
{
if (!silent)
fprintf(stderr, "gbx" GAMBAS_VERSION_STRING ": % 5d %s\n", class->count, class->name);