From 1756d4379659f2b9ddc6a5b1782615e94b353cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 12 Sep 2012 02:45:49 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * OPT: Delay the welcome dialog project list layouting as much as possible. git-svn-id: svn://localhost/gambas/trunk@5159 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.lang/.pot | 20 ++++---- .../gambas3/.src/Project/ProjectItem.class | 4 +- app/src/gambas3/.src/Welcome/FWelcome.class | 47 ++++++++++++++++--- app/src/gambas3/.src/Welcome/FWelcome.form | 3 ++ 4 files changed, 56 insertions(+), 18 deletions(-) diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 2e2418087..03a14c304 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -533,7 +533,7 @@ msgstr "" msgid "No terminal emulator found." msgstr "" -#: FAbout.form:21 FWelcome.class:50 +#: FAbout.form:21 FWelcome.class:53 msgid "About Gambas..." msgstr "" @@ -2633,15 +2633,15 @@ msgstr "" msgid "Sort history" msgstr "" -#: FMain.class:571 FOpenProject.form:116 FWelcome.form:38 +#: FMain.class:571 FOpenProject.form:116 FWelcome.form:39 msgid "Sort by date" msgstr "" -#: FMain.class:571 FOpenProject.form:125 FWelcome.form:45 +#: FMain.class:571 FOpenProject.form:125 FWelcome.form:46 msgid "Sort by name" msgstr "" -#: FMain.class:571 FOpenProject.form:133 FWelcome.form:51 +#: FMain.class:571 FOpenProject.form:133 FWelcome.form:52 msgid "Sort by path" msgstr "" @@ -2871,7 +2871,7 @@ msgstr "" msgid "The packages have been successfully created." msgstr "" -#: FMakeInstall.class:299 FSave.class:28 FWelcome.class:51 +#: FMakeInstall.class:299 FSave.class:28 FWelcome.class:54 msgid "Quit" msgstr "" @@ -3076,7 +3076,7 @@ msgstr "" msgid "Recent" msgstr "" -#: FOpenProject.form:148 FWelcome.class:49 +#: FOpenProject.form:148 FWelcome.class:52 msgid "Examples" msgstr "" @@ -4306,19 +4306,19 @@ msgstr "" msgid "The 'msgmerge' command has failed" msgstr "" -#: FWelcome.form:30 +#: FWelcome.form:31 msgid "Welcome to Gambas 3" msgstr "" -#: FWelcome.class:46 +#: FWelcome.class:49 msgid "New project..." msgstr "" -#: FWelcome.class:47 +#: FWelcome.class:50 msgid "Open project..." msgstr "" -#: FWelcome.class:48 +#: FWelcome.class:51 msgid "Recent projects" msgstr "" diff --git a/app/src/gambas3/.src/Project/ProjectItem.class b/app/src/gambas3/.src/Project/ProjectItem.class index 40de1a948..968db0aeb 100644 --- a/app/src/gambas3/.src/Project/ProjectItem.class +++ b/app/src/gambas3/.src/Project/ProjectItem.class @@ -260,6 +260,9 @@ Private Function IdealHeight_Read() As Integer Endif $iIdealH = H + + 'Debug File.Name($sPath);; $iIdealW;; $iIdealH + Return H End @@ -303,7 +306,6 @@ End Public Sub ProjectItem_BeforeArrange() - If Not Me.Visible Then Return Me.H = Me.IdealHeight End diff --git a/app/src/gambas3/.src/Welcome/FWelcome.class b/app/src/gambas3/.src/Welcome/FWelcome.class index 50f0532b2..5828196d7 100644 --- a/app/src/gambas3/.src/Welcome/FWelcome.class +++ b/app/src/gambas3/.src/Welcome/FWelcome.class @@ -40,6 +40,9 @@ Public Sub Form_Open() Dim sFont As String Dim hCtrl As CCoolButton + Settings.Read(Me) + Me.Center + sFont = "Bold" W = panButton.ClientW @@ -69,9 +72,6 @@ Public Sub Form_Open() '$hWelcome = New CWelcome(dwgWelcome) - Settings.Read(Me) - Me.Center - End @@ -436,7 +436,6 @@ Private Sub FillRecent() 'Dim bHighlight As Boolean Dim sTitle As String Dim sLastTitle As String - Dim Y As Integer Dim hDrawingArea As DrawingArea If lstRecent.Count And If Not CRecentFile.OutOfDate Then Return @@ -462,14 +461,15 @@ Private Sub FillRecent() .Font = Font["Bold"] .H = .Font.Height + If(sLastTitle, 16, 8) .Foreground = Color.SelectedBackground - Y += .H + 'Y += .H End With sLastTitle = sTitle Endif hProjectItem = New ProjectItem(lstRecent) As "ProjectItem" - hProjectItem.Y = Y - Y += hProjectItem.H + Object.Lock(hProjectItem) + 'hProjectItem.Y = Y + 'Y += hProjectItem.H 'If bHighlight Then hProjectItem.Background = Color.LightBackground 'bHighlight = Not bHighlight If Not hFirst Then hFirst = hProjectItem @@ -484,6 +484,8 @@ Private Sub FillRecent() Dec Application.Busy + timLayout.Trigger + End Private Sub FillExample() @@ -522,6 +524,7 @@ Private Sub FillExample() hProjectItem = New ProjectItem(lstExample) As "ProjectItem" 'If bHighlight Then hProjectItem.Background = Color.LightBackground 'bHighlight = Not bHighlight + Object.Lock(hProjectItem) hProjectItem.Path = Project.EXAMPLES_DIR &/ sExample hProjectItem.Group = sGroup @@ -532,6 +535,8 @@ Private Sub FillExample() Object.Unlock(lstExample) Dec Application.Busy + + timLayout.Trigger End @@ -566,3 +571,31 @@ Public Sub dwgTitle_Draw() Draw.RichText(sText, 8, 0, Draw.W - 16, Draw.H - 16, Align.TopLeft) End + +Public Sub timLayout_Timer() + + Dim hList As ListContainer + Dim hCtrl As Control + Dim hProjectItem As ProjectItem + + If $iRecent = LIST_RECENT Then + hList = lstRecent + Else + hList = lstExample + Endif + + hList.Lock + + For Each hCtrl In hList.Children + + If hCtrl Is ProjectItem Then + hProjectItem = hCtrl + Object.Unlock(hProjectItem) + hProjectItem.ProjectItem_BeforeArrange + Endif + + Next + + hList.Unlock + +End diff --git a/app/src/gambas3/.src/Welcome/FWelcome.form b/app/src/gambas3/.src/Welcome/FWelcome.form index 9a8b02fb1..9db836e98 100644 --- a/app/src/gambas3/.src/Welcome/FWelcome.form +++ b/app/src/gambas3/.src/Welcome/FWelcome.form @@ -29,6 +29,9 @@ MoveScaled(1,1,66,21) Visible = False } + { timLayout #Timer + #MoveScaled(72,14) + } { Panel1 Panel MoveScaled(19,23,14,0) Visible = False