Announcement

Collapse
No announcement yet.

FireFly Visual Designer for PowerBASIC

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

  • Paul Squires
    replied
    FireFly Visual Designer has been updated to fully support the PB9 compiler. See announcement at: http://www.powerbasic.com/support/pb...ad.php?t=38461

    Leave a comment:


  • Paul Squires
    replied
    The FireFly Visual Designer is not just pretty eye candy. It allows the programmer to do things with controls that are cumbersome for a lot of people with an ease of simplicity that is hard to imagine.

    For example, working with TextBoxes (i.e. Edit controls) can be a bit of a pain if you need to do anything out of the ordinary with them. Most times, you will have to resort to subclassing the text box. Just the word 'subclassing' causes some people to shy away immediately. In FireFly, there is no need to subclass the text box. You have access to all of the capabilities of subclassing without ever having to write a line of subclassing code.

    Here are a few examples of dealing with a FireFly TextBox. Take note of just how easy it is. You can deal with messages that are only available via subclassing in a manner that is no different than dealing with standard non-subclassed text boxes. It can't get any easier than this.

    Say that you want to filter out characters from being entered into the TextBox. In this case we have a TextBox named 'txtCustName' and we do not want the letters "P" or "p" to be entered.

    Code:
    '--------------------------------------------------------------------------------------
    Function MYFORM_TXTCUSTNAME_WM_CHAR ( _
                                        ControlIndex  As Long,  _  ' index in Control Array
                                        hWndForm      As Dword, _  ' handle of Form
                                        hWndControl   As Dword, _  ' handle of Control
                                        chCharCode    As Long,  _  ' character code
                                        lKeyData      As Long   _  ' key data
                                        ) As Long
    
       ' Filter out any unwanted characters by returning
       ' a %TRUE value from the function. This will prevent
       ' the WM_CHAR message handler from forwarding the
       ' character request to the default windows handler.
       Select Case chCharCode
          Case 80, 112     ' ASCII codes for 'P' and 'p'  
             Function = %TRUE 
       End Select      
          
    End Function
    Next, there are applications where it is convenient to be able to TAB to the next control by pressing the ENTER key while in a TextBox. With FireFly, this is very simple. I can image this type of code being used in a data entry type of Form.

    Code:
    '---------------------------------------------------------------------------------------
    Function MYFORM_TXTCUSTNAME_WM_KEYUP ( _
                                         ControlIndex  As Long,  _  ' index in Control Array
                                         hWndForm      As Dword, _  ' handle of Form
                                         hWndControl   As Dword, _  ' handle in Control
                                         nVirtKey      As Long,  _  ' virtual key code
                                         lKeyData      As Long   _  ' key data
                                         ) As Long
    
       ' Handle the ENTER key. Treat it like pressing the TAB key
       ' to simulate moving to the next WS_TABSTOP field. Once we
       ' intercept the ENTER key we simply call the API function that
       ' gets the get tabstop control and we set our focus to it.
       Select Case nVirtKey
          Case %VK_RETURN
             SetFocus GetNextDlgTabItem( hWndForm, hWndControl, %FALSE )
             Function = %TRUE
       End Select
             
    End Function
    How about something a little stranger? Say, you have a requirement to know when your mouse cursor is over the TextBox. Here is how easy it is to this:
    Code:
    '--------------------------------------------------------------------------------------------------
    Function MYFORM_TXTCUSTNAME_WM_MOUSEMOVE ( _
                                             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
       
       ' When the mouse goes over the textbox, display the client screen
       ' coordinates in the caption of the parent Form.
       FF_Control_SetText hWndForm, "xPos:" & Str$(xPos) & " yPos:" & Str$(yPos)
       
    End Function
    See what I mean? Dealing with subclassing in FireFly is a no-brainer. Okay, maybe you don't need to deal with the depths of the TextBox control like in the samples above. If you simply need to react to when the text changes in a TextBox then you can use the EN_CHANGE notification message handler:
    Code:
    '---------------------------------------------------------------------------------------------
    Function MYFORM_TXTCUSTNAME_EN_CHANGE ( _
                                          ControlIndex   As Long,  _  ' index in Control Array
                                          hWndForm       As Dword, _  ' handle of Form
                                          hWndControl    As Dword, _  ' handle of Control
                                          idTextControl  As Long   _  ' identifier of text control
                                          ) As Long
       
       ' Whenever the text in the txtCustName TextBox changes, update the
       ' caption of the Form.
       Local sCustName As String
       
       sCustName = FF_TextBox_GetText( hWndControl )
       
       FF_Control_SetText hWndForm, sCustName
       
    End Function
    I'll leave it to you to decide whether FireFly fits your needs. Please head on over to the PlanetSquires website and download a free, 30-day trial today. You can get FireFly from http://www.planetsquires.com/firefly.htm

    Leave a comment:


  • Paul Squires
    replied
    So, what makes FireFly so easy to use?

    In FireFly, Windows events are captured for each Form/Control in your application and are processed in separate 'Message Handlers' that allow the programmer to create highly maintainable and modularized code, leading to less potential for errors in the long run. You are not forced into this approach (although it is encouraged). You could bypass the modular behavior altogether if you wish by simply placing all of your code into the Form's CUSTOM message handler - all message can be processed there, except for WM_CREATE).

    This is how the modular coding looks in practice. In this extremely simple example we have a Form called 'MyForm' with a Command button called 'cmdOK' and a ListBox called 'lstCustomers'. The ListBox is loaded during the WM_CREATE message handler and a message box displays whenever the selection in the ListBox changes. Notice that FireFly uses the standard Windows message names allowing you to leverage your knowledge of existing Windows methodologies.

    Code:
    '-------------------------------------------------------------------------------------
    Function MYFORM_WM_CREATE ( _
                              hWndForm As Dword, _      ' handle of Form
                              ByVal UserData As Long _  ' optional user defined Long value
                              ) As Long
    
       ' Add some customers to the ListBox
       FF_ListBox_AddString HWND_MYFORM_LSTCUSTOMERS, "PlanetSquires"
       FF_ListBox_AddString HWND_MYFORM_LSTCUSTOMERS, "PowerBASIC"
       FF_ListBox_AddString HWND_MYFORM_LSTCUSTOMERS, "Microsoft"
       FF_ListBox_AddString HWND_MYFORM_LSTCUSTOMERS, "Google"
       
       ' Select the first customer (ListBoxes are zero based)
       FF_ListBox_SetCurSel HWND_MYFORM_LSTCUSTOMERS, 0
       
    End Function
    
    
    '--------------------------------------------------------------------------------------
    Function MYFORM_CMDOK_BN_CLICKED ( _
                                     ControlIndex     As Long,  _  ' index in Control Array
                                     hWndForm         As Dword, _  ' handle of Form
                                     hWndControl      As Dword, _  ' handle of Control
                                     idButtonControl  As Long   _  ' identifier of button
                                     ) As Long
       
       FF_CloseForm hwndForm
       
    End Function
    
    
    '---------------------------------------------------------------------------------------------
    Function MYFORM_LSTCUSTOMERS_LBN_SELCHANGE ( _
                                               ControlIndex  As Long,  _  ' index in Control Array
                                               hWndForm      As Dword, _  ' handle of Form
                                               hWndControl   As Dword, _  ' handle of Control
                                               idListBox     As Dword  _  ' identifier of listbox
                                               ) As Long
       
       Local sCustomer As String
       Local nCurSel   As Long
       
       ' Get the selected customer and display it
       nCurSel = FF_ListBox_GetCurSel( hWndControl )
    
       If nCursel >= 0 Then
          sCustomer = FF_ListBox_GetText( hWndControl, nCurSel )
          MsgBox sCustomer,, "Selected Customer"
       End If   
       
    End Function
    Now that is pretty painless! Notice the use of the "FF_" prefixed functions. Those are called "FireFly Functions" and there are loads of them already defined for your use. Everything from Command Buttons, Check Boxes, List Boxes to Progress Bars, TreeViews, etc... You will hardly ever have to use any other Windows functions but the beauty of FireFly is that every Windows API function can be used with FireFly. You can use any many or as few of them as you feel comfortable.

    In the above example, you can see that we are handling three Windows messages: WM_CREATE, BN_CLICKED, LBN_SELCHANGE.

    The WM_CREATE message is a place where you can populate your controls with required data, set controls visible/hidden or simply enable/disable them. Basically, anything you need to do prior to the Form being displayed.

    The BN_CLICKED message is a notification message that signifies that the Command Button named 'cmdOK' has been clicked. In our example we call the built in FireFly Function 'FF_FormClose' to simply close the Form and end our application.

    The LBN_SELCHANGE notification message is received whenever we change rows in the ListBox. In the example, we retrieve the index to the new row and retrieve the text of the Customer name and display it in a message box.

    When you compile the project, FireFly will gather up all of your message handlers and generate the behind the scenes code that ties them to the application's message loop and windows procedure functions. All of that messy "API" stuff that people love to fear monger with is taken care for you. You never have to see it, edit it, or have to deal with it. FireFly will generate it and call the PB compiler to create the EXE or DLL for you. FireFly will even automatically delete the generated code if you really don't want it anymore.

    FireFly is easy to use and it will make you more productive. It may not get you more girlfriends or help you plan that summer vacation you've been longing for, but it *will* enhance your programming experience and enable you to produce applications more quickly and efficiently.

    FireFly is only $99. Compare it to other visual design tools available for PowerBASIC and you will quickly find that it is an incredible value. You bought the best BASIC compilier available... now do yourself a favor and treat yourself to bit of luxury with the FireFly Visual Designer. Haven't you waited long enough?

    http://www.planetsquires.com/firefly.htm

    Leave a comment:


  • Paul Squires
    started a topic FireFly Visual Designer for PowerBASIC

    FireFly Visual Designer for PowerBASIC

    Hi Everyone,

    As hundreds of you already know, FireFly Visual Designer makes designing your PowerBASIC programs a breeze. Why struggle designing your graphical user interfaces? With FireFly you can spend more time writing your code than moving controls via code a pixel or two at a time until you get it right. Sheesh, that is such a waste of your valuable programming time.

    FireFly 2 has been serving the PowerBASIC market with great success for a long time. FireFly users are proud users who love the product and best of all, "get things done - fast".

    FireFly 3 is in the works and will prove to be another giant leap forward in visual design for PowerBASIC. More details on that to follow later...

    If you have been wanting a proven visual design tool then do yourself a favor and download FireFly today. You get to try it for free for 30 days. Give it a good workout and decide for yourself if it suits your needs. Feel free to stop over to the PlanetSquires forums if you need some help. I'll be more than happy to see you there and help you the best that I can.

    Download from: http://www.planetsquires.com/firefly.htm

    Okay, here is the hard sell, hold on it won't be too painful - I promise.

    Why FireFly?
    • No runtime DLLs (Dynamic Link Libraries) of any kind. Every FireFly created application is totally self-contained and does not require any supporting DLLs to be distributed. Please note: If your application requires any 3rd party custom controls then you will have to distribute those DLL's with the FireFly generated EXE. However, FireFly does not use any runtime libraries like Visual Basic.
    • OCX and ActiveX support. Easily integrate visual COM/ActiveX programming into FireFly programs.
    • Built-in support for Microsoft's ADO and ADOX (Active Data Objects) database support.
    • Choose from almost 200 internal functions that make combining your code with TreeViews, ListViews, Labels, Command Buttons, TabControls, ProgressBars, etc... extremely easy. You can code entire applications without any Win32 API knowledge.
    • Modular Code. FireFly allows the programmer to "attach" code to individual window's messages that are destined for the controls that you create. Separating the code for each control allows for highly maintainable code and discourages the use of bug causing global variables. The code editor is "built in" - no need to shell back and forth between a designer and a code editor.
    • WYSIWYG Designer. In the tradition of many of today's powerful visual designers, FireFly presents a "what you see is what you get" design experience. Easily create controls, re-size and move them, and apply different visual characteristics to them. FireFly handles all of the tedious code creation. Easily create and modify forms and controls with ease. Position controls with precision. Create menus, toolbars and statusbars effortlessly.
    • Easily create form templates that can be re-used in new projects. You can even create templates for menus, toolbars and statusbars.
    • Design MDI (Multiple Document Interface) applications in seconds.
    • 3rd Party Custom Controls can integrate directly into FireFly. This allows you to use 3rd party controls as if they were standard, native Windows controls. Simply select the tool from the FireFly Toolbox. You can even assign property values at design time as well as respond to custom messages at run-time.
    • Harness the power of the Windows API and never feel constrained by pre-determined programming methods. With the Windows API you have the ultimate degree of coding power in your possession. Windows API coding is not difficult and the benefits are truly amazing! You picked PowerBASIC as your compiler... now pick the Windows API to ensure that you retain that level of ultra-small, ultra-fast executables.


    Whew, that's a lot and it only scratches the surface of what FireFly can do for you.

    Hope to see you soon as a FireFly user.
Working...
X