PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Advice on a few questions I have  (Read 478 times)

andygable

  • FireFly3 User
  • Little Newbie FireFly
  • *
  • Posts: 4
Advice on a few questions I have
« on: February 06, 2017, 01:42:50 PM »

Hi everyone,

I want to ask a few things.

1. I had a form called frmSplash and this was a normal form and when my project compiled it works perfectly (show just how I wanted) then I added a Mdi Parent form and called it frmbackground and now my frmsplash has vanished from the start form / Function list. How do I select a function in the drop down list (does it have to be named a certain way)

2. How do I make a Password text entry box? (there is no option to make it show just a * then a password is entered)

3. How Do I show a form once the Mdi parent has loaded? I want to show a form called frmSignOn
3a. how to load another form when a button is clicked

4. In a Mdi Parent how can I have a group box (in vb.net I can have my logo of my company insiude a panel control on the Main
mdi form)

5. How Do I do multiple lines on a command button? (in vb.net I could use Shift & enter and it would then place the next line underneath the first one)

I would like to move away from vb.net but at this rate I think I am going to have to keep my Back office systems in vb.net it is a shame as I really like FreeBASIC (and I also like how FireFly feels still it is VERY complciated to do some very simple things with it at the moment)
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: Advice on a few questions I have
« Reply #1 on: February 06, 2017, 02:46:17 PM »

(1)
It is by design that when a MDIForm is used in a Firefly project that it becomes the startup form. This can not be changed.

I remember the topic of Splash screens coming up a few years ago. The consensus was to display the main startup form and then post a message to display the splash form using a Timer on the splash form to close it after a specified interval.

Code: [Select]
Const MSG_USER_SHOWSPLASH = WM_USER + 100

'--------------------------------------------------------------------------------
Function MDIFORM1_WM_CREATE ( _
                            hWndForm as HWnd, _          ' handle of Form
                            ByVal UserData as Integer _  ' optional user defined value
                            ) as Long

   ' Post a user defined message to show the splash screen once the MDI form
   ' has loaded and is shown.
   PostMessage( hWndForm, MSG_USER_SHOWSPLASH, 0, 0 )

   Function = 0   ' change according to your needs
End Function


'--------------------------------------------------------------------------------
Function MDIFORM1_CUSTOM ( _
                         hWndForm      as HWnd, _      ' handle of Form
                         wMsg          as UInteger,  _  ' type of message
                         wParam        as WPARAM, _    ' first message parameter
                         lParam        as LPARAM   _   ' second message parameter
                         ) as Long

   Select Case wMsg
      Case MSG_USER_SHOWSPLASH
         frmSplash_Show(hWndForm, True)
         
   End Select   

   Function = 0   ' change according to your needs
End Function


And from the frmSplash form:

Code: [Select]


'--------------------------------------------------------------------------------
Function FRMSPLASH_TIMER1_WM_TIMER ( _
                                   hWndForm      as HWnd, _     ' handle of Form
                                   wTimerID      as Long  _  ' the timer identifier
                                   ) as Long

   ' This will fire after the timer period expires based on the "Interval"
   ' property defined (in milliseconds).
   ' Simply close the splash screen
   FF_CloseForm( hWndForm )
   
   Function = 0   ' change according to your needs
End Function
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: Advice on a few questions I have
« Reply #2 on: February 06, 2017, 03:01:25 PM »

2. How do I make a Password text entry box? (there is no option to make it show just a * then a password is entered)

Select the ES_PASSWORD style under WindowStyles for the TextBox.

Quote
3. How Do I show a form once the Mdi parent has loaded? I want to show a form called frmSignOn
3a. how to load another form when a button is clicked
You load and show MDI children forms by first creating the MDIChild form and setting it's MDIChild property to TRUE. You show MDI child forms using the MDI Client as the Parent form... not the MDI Frame. A lot of people make this mistake.
Code: [Select]
Form1_Show(HWND_MDIFORM1_MDICLIENT, False)

If you are wanting to show a normal popup type of form then you can use the frame or client as the parent. Shouldn't matter. Obviously, in this case the MDIChild property of the Form is set to False.
Form1_Show(HWND_MDFORM1, True)
Form1_Show(HWND_MDIFORM1_MDICLIENT, True)

Quote
4. In a Mdi Parent how can I have a group box (in vb.net I can have my logo of my company insiude a panel control on the Main
mdi form)
By design, in Firefly you can not add child controls to the MDI Client form from within the designer. In your case you would have to manually add the controls you need to the client form via code using CreateControlEx api. You can do this in the WM_CREATE for the MDICLIENT form.
Code: [Select]
'--------------------------------------------------------------------------------
Function MDIFORM1_MDICLIENT_WM_CREATE ( _
                                      hWndForm as HWnd, _          ' handle of Form
                                      ByVal UserData as Integer _  ' optional user defined value
                                      ) as Long

   Function = 0   ' change according to your needs
End Function

Quote
5. How Do I do multiple lines on a command button? (in vb.net I could use Shift & enter and it would then place the next line underneath the first one)
In the Designer, you need to set the WindowStyle of the button to use BS_MULTILINE. You can not set multiline text via the designer so you have to do it in code (usually in the WM_CREATE of the form).
Code: [Select]
   FF_Control_SetText(HWND_FORM1_COMMAND1, "Firstline" & Chr(13, 10) & "Second line")

Quote
I would like to move away from vb.net but at this rate I think I am going to have to keep my Back office systems in vb.net it is a shame as I really like FreeBASIC (and I also like how FireFly feels still it is VERY complciated to do some very simple things with it at the moment)
I can understand your frustration. If you have not come from a Win32 Windows API programming background then things in Firefly may be challenging.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor