PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Elias Montoya on August 20, 2007, 07:52:33 PM

Title: My App hangs...
Post by: Elias Montoya on August 20, 2007, 07:52:33 PM

I have a tab control with 3 Forms. Each form is designed also in Firefly and i attach it to the tabs of the tab control using this code:

'------------------------------------------------------------------------------------------------------------------------                                     
Function SetTabChildWindow(ByVal hCtrl As Long, ByVal nTabIndex As Long, Hdlg As Long, Caption as String) As Dword

   Local TCITEM  As TC_ITEM
   TCITEM.mask = %TCIF_PARAM
   TabCtrl_GetItem Hctrl, nTabIndex, TCITEM                           
   TCITEM.lparam = Hdlg
   DLGS(nTabIndex) = Hdlg
   TCITEM.mask = %TCIF_PARAM
   SetParent Hdlg, HCtrl
   Local RC As Rect
   GetWindowRect Hctrl, RC
   SetWindowPos Hdlg, 0, _
                  0, 24, _
                  (rc.nRight-RC.NLEFT)-4, (rc.nBottom-RC.NTOP)-25, _
                  %SWP_NOZORDER Or %SWP_NOREDRAW
   ShowWindow Hdlg, %SW_HIDE
   TabCtrl_SetItem Hctrl, nTabIndex, TCITEM
   FF_TabControl_SetText (Hctrl, Caption, nTabIndex)   
   Function = %true

End Function


When i press a button in the dialog containing the tab control, it works. But when
i press a button in a form contained in the tab control, the app hangs, even if the
button procedure is empty.

Any ideas why is this happening?

Title: Re: My App hangs...
Post by: TechSupport on August 20, 2007, 08:29:09 PM
Why aren't you using FireFly's built in method of assigning the child Forms to the Tab Control? Why are you trying to do it manually? It would be a lot easier to use the "Custom" property of the TabControl control and assign the child Forms to each tab. Am I missing something about your approach?
Title: Re: My App hangs...
Post by: Elias Montoya on August 20, 2007, 09:47:34 PM

Is there a Firefly Approach? I dont know it. Where do i learn it?
Title: Re: My App hangs...
Post by: TechSupport on August 20, 2007, 11:07:23 PM
Quote from: Elias Montoya on August 20, 2007, 09:47:34 PM

Is there a Firefly Approach? I dont know it. Where do i learn it?
There sure is. The "Custom" property of the TabControl control and assign the child Forms to each tab. It is very easy using this method. I have attached a screenshot of the "Custom" dialog that appears when that property is selected.

Title: Re: My App hangs...
Post by: Elias Montoya on August 20, 2007, 11:29:30 PM

I saw that, but i thought it was only for naming and adding the tabs.

How do i specify a dialog for each tab? I tried everything but i cant attach
a dialog to a tab from there. Do i have to set a special flag in the dialogs
i want to use in the tabs?

The "Child Page Dialog" combobox doesnt display any options, and i cant type
anything there...
Title: Re: My App hangs...
Post by: Elias Montoya on August 20, 2007, 11:39:22 PM

Ugh... Answer was It was on the help file. Thanx paul, works great. :)
Title: Re: My App hangs...
Post by: TechSupport on August 21, 2007, 08:39:18 AM
Quote from: Elias Montoya on August 20, 2007, 11:39:22 PM

...Answer was It was on the help file.
No worries, I never read help files things either!  :D