Announcement

Collapse
No announcement yet.

firefly newbie: where do I put dll inits?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • firefly newbie: where do I put dll inits?

    Though I bought FireFly last year I just really starting using FireFly today.
    I've only used PBForms before (DDT).
    I'd like to say that in about a half hour I was pretty comfortable with creating my multi-tabbed form. I can see FireFly is going to save me some time (thanks Paul).

    Anyway, I have a dumb question:
    I plan to use sqlTools with this particular program.

    Normally I would put the command to open the database and close the database in the pbmain function. Same goes with other tools inits (like socket tools). Where do I put that stuff now?



    thanks

  • #2
    You can do init stuff in FF_WINMAIN or in the XX_WM_CREATE of your main form, and to shutdown anything on close, you can use XX_WM_DESTROY on the main form.

    Comment


    • #3
      perfect, thanks elias

      Comment


      • #4
        Originally posted by Shawn Anderson View Post
        I can see FireFly is going to save me some time (thanks Paul).
        Thanks Shawn! I appreciate it.

        Elias is spot on with his answer.
        Paul Squires
        FireFly Visual Designer (for PowerBASIC Windows 10+)
        Version 3 now available.
        http://www.planetsquires.com

        Comment


        • #5
          next question

          nevermind.... it was me this time
          Last edited by Shawn Anderson; 15 Jan 2009, 05:05 PM.

          Comment


          • #6
            listview

            I'm not sure I'm implementing my listview correctly with firefly.

            I want to return the value of whatever is in the the leftmost field of the selected row when clicked upon.

            Code:
            Function CLIENT_CLIENTLISTVIEW_WM_LBUTTONDOWN ( _
                                                          ControlIndex  As Long,  _  ' index in Control Array
                                                          hWndForm      As Dword, _  ' handle of Form
                                                          hWndControl   As Dword, _  ' handle of Control
                                                          MouseFlags    As Long,  _  ' virtual keys that are pressed
                                                          xPos          As Long,  _  ' x-coordinate of cursor
                                                          yPos          As Long   _  ' y-coordinate of cursor
                                                          ) As Long
            
            	Local clientID As String
            	Local lvIndex As Long       
                                                     
                                                         
            	 lvIndex = ListView_GetNextItem( hwnd_client_clientListview, -1, %LVNI_SELECTED )+1   
            	 
            	 If lvIndex> 0 Then  
                
            	 	ListView Get Text hwnd_client, idc_client_clientListview, lvIndex, 1 To clientID
            	 
            	 	MsgBox clientID   
            
            	 End If                                                                                          
            
            End Function
            when I click on the listview data, it grabs what is currently selected, then moves focus onto what was clicked, if that makes sense.

            What am I doing wrong?

            Comment


            • #7
              I changed the trigger from lbuttondown to lbuttonup and that works better, but I still have to double click.

              It feels like I'm doing something wrong....

              Comment


              • #8
                OK, I've added itemchanged, and that seems to work like I expect.
                It also works with the arrow buttons.

                thoughts?

                Comment


                • #9
                  Definitely - use the LVN_ITEMCHANGED. That is the actual Listview notification that gets sent to the Form when an item has been clicked on in the ListView. Using the LBUTTONDOWN/LBUTTONUP messages is not the best choice for this scenario.

                  Code:
                  Function FORM1_LISTVIEW1_LVN_ITEMCHANGED ( _
                                                           ControlIndex  As Long,            _  ' index in Control Array
                                                           hWndForm      As Dword,           _  ' handle of Form
                                                           hWndControl   As Dword,           _  ' handle of Control
                                                           ByVal lpNMV   As NM_LISTVIEW Ptr  _  ' pointer to NM_LISTVIEW
                                                           ) As Long
                  
                  End Function
                  If you want to deal with the current item row *prior* to it changing to the newly selected row then use the LVN_ITEMCHANGING message handler.
                  Paul Squires
                  FireFly Visual Designer (for PowerBASIC Windows 10+)
                  Version 3 now available.
                  http://www.planetsquires.com

                  Comment


                  • #10
                    Shawn - don't forget to take a look at the FireFly Forums over on the PlanetSquires site. Lots of questions asked and answered over there about the various controls. http://planetsquires.com/support/index.php
                    Paul Squires
                    FireFly Visual Designer (for PowerBASIC Windows 10+)
                    Version 3 now available.
                    http://www.planetsquires.com

                    Comment


                    • #11
                      Originally posted by Paul Squires View Post
                      Shawn - don't forget to take a look at...

                      Also take a look at the goodies on the F8 key.

                      Comment


                      • #12
                        Awesome, thanks!

                        Comment

                        Working...
                        X