Announcement

Collapse
No announcement yet.

A new Visual Designer for JK-IDE

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

  • A new Visual Designer for JK-IDE

    Hi all,


    Two years ago i started writing first code snippets for this Visual Designer. I expected this task to take me 6 to 9 month to complete. Now two years later i feel i can release a first public BETA version of it.

    It turned out to be an extremly complicated and demanding task, but i´m quite satisfied with the outcome. Me and some beta testers did our best to find and fix bugs and at current stage i´m out of ideas, what more to test. Therefore i decided to release a first public BETA version. As a developper you tend to get blind for certain things, so i´m pretty sure there are some more bugs and issues to discover.

    There is still some documentation to be written and depending on your feedback, i will also expand on topics, which need more explanation.

    This Visual Designer creates pure SDK code and it can be used only in conjunction with my IDE. SDK code means code implementing the Windows API functions without wrappers or any other dependecy. You cannot use it for PowerBASIC´s proprietary DDT format and you must be willing to deal with the Windows API.

    If you want to write DDT code, please purchase PBForms, if you don´t want to deal with the Windows API, buy a copy of EZGUI by Chris Boss. The main advantage of SDK code is, that it is the generic way of coding in Windows, SDK code can easily be ported to other languages, because the Windows API is the same for all languages.

    Currently it doesn´t cover each and every possible implementation of each and every common control, but it covers the most common situations for most controls including customdraw and ownerdaw. It does the tedious work by creating a compilable skeleton, which then must be filled with "life".

    It is highly customizable in many aspects and you can add own or third party controls too.


    While JK-IDE is basically free (though i accept donations) JK_VD in it´s full version is not free. The version comming with the IDE is a demo version. You can use it´s full feature set unlimited times. But the layout files holding all necessary information for generating code can be reused only for one day and/or to a total number of five times. Afterwards trying to use such a layout will open a message box telling you the trial period has expired. You can create a new layout though. For an unrestricted use you need some extras, which will unlock expired layouts too.

    In order to get a full version you must make a donation of 50$ or more. Click the "Support" button in the about box (Help Menu/About JK-IDE). A PayPal donation page will appear in your default browser. Please paste (Ctrl+V) into the "Purpose" text field, a 16 digit hex number (transfer id) should be visible now. I need this number and a valid e-mail to return the things needed to make it a full version.

    All people, who already have made a donation, will get a free copy, if the they want, regardless of the amount of the donation made. These people should send me a mail with the transfer id. You get this transfer id by following the above steps (click "Support" ...) afterwards the id is inside your clipboard and ready for pasting.


    Shipping isn´t an automated process, it might take some time, because i will have to do this by hand. So please wait at least for two days, if you didn´t receive an e-mail within two days, please drop me a mail ([email protected]). In the past i experienced trouble with some mail providers, because my mails were blocked as "spam" or "potential threat". A private message in the forum could be a way to circumvent such communication problems.


    Please note:
    At current stage it is still a BETA version, so please be warned, if you want to do serious work with it - there might be changes/bug fixes possibly invalidating existing layouts. I did everything comming to my mind to avoid such a situation, but currently i cannot guarantee for it.


    I expect your comments, requests for features or feature improvements and of course bug reports. If you followed my IDE thread you know, that i will fix problems. As soon as there is enough public proof showing the VD is stable, i will release an offical version 1.0



    JK

  • #2
    Congrats, Juergen!

    I know you've put a ton of work in to the VD and I'm sure you'll get a ton of feedback!

    Comment


    • #3
      Originally posted by Juergen Kuehlwein View Post
      I expect your comments, requests for features or feature improvements and of course bug reports. If you followed my IDE thread you know, that i will fix problems. As soon as there is enough public proof showing the VD is stable, i will release an offical version 1.0[/SIZE]
      ]
      First, congratulations of getting this project his far. I can only imagine (probably inadequately) how complicated this was to put together. From my perspective as a developer, the most important feature for a visual designer is that it simplify the implementation of the tab control. I've got extensive experience with FireFly, and the ease of creating program interfaces using a tab control is the main reason we keep using it.
      Real programmers use a magnetized needle and a steady hand

      Comment


      • #4
        Hey Bud!
        That's a very interesting statement, perhaps one of those YMMV things. In all the stuff I've published, I might have used a TAB control perhaps a half dozen times. It just hasn't factored much into the stuff I like to write. I can think of zillions of reasons to use one, but just haven't found the need myself.

        But to your point, if it was easier to use, then perhaps I'd have used it more!

        Comment


        • #5
          Hi Bud,


          i don´t know what features you expect for a tab control. But tab controls are supported like any other standard Windows controls. Apart from positionig and sizing a tab control the designer allows for specifying the total number of tabs to create, a text for each tab and if and which image should be drawn for a tab. This applies to all controls using images. It even supports customdraw and ownerdraw, where applicable.

          I my view, it doesn´t make sense at all to port an existing project to my Designer. Other Projects (created without a Visual Designer) can be ported with ease.

          But you could play with my designer and tell me, if it does what you basically expect and what isn´t sufficient and why.


          JK

          Comment


          • #6
            Originally posted by Gary Beene View Post
            In all the stuff I've published, I might have used a TAB control perhaps a half dozen times. It just hasn't factored much into the stuff I like to write. I can think of zillions of reasons to use one, but just haven't found the need myself.

            But to your point, if it was easier to use, then perhaps I'd have used it more!
            Most of the apps we've devloped at work to supplement our ERP and inventory systems use a tabbed interface. Including our main production reporting app. When I started developing that (8 years ago!), I jumped from PBForms to FireFly solely because I couldn't then wrap my head around getting the tabbed interface created in PBForms. I'm more experienced with Win32 now, so probably if I concentrated I could do it, but there's little payback in re-writing the app at this time.

            Real programmers use a magnetized needle and a steady hand

            Comment


            • #7
              Originally posted by Juergen Kuehlwein View Post
              i don´t know what features you expect for a tab control. But tab controls are supported like any other standard Windows controls. Apart from positioning and sizing a tab control the designer allows for specifying the total number of tabs to create, a text for each tab and if and which image should be drawn for a tab
              Hi Juergen;

              I suppose I was not very clear. Here's the basic steps I'm used to:
              1. create a form (main form), place and position a tab control on it
              2. set up the tab control: number of tabs, tab labels, etc.
              3. create another form, define it as a child form. Place controls (labels, text boxes, etc) on it.
              4. back to the main form's tab control, set it to display the child form on tab #1
              5. repeat steps 3 & 4 as needed
              Thanks for the response, and I am definitely going to take your visual designer for a spin.


              Real programmers use a magnetized needle and a steady hand

              Comment


              • #8
                For me this is the better Visual Designer...but is not for PowerBasic. I am mix PowerBasic with Longtion Radbuilder.

                It would be great if there was one like this for PowerBasic.

                http://www.longtion.com/radbuilder/radbuilder.html

                Click image for larger version  Name:	image_8699.png Views:	1 Size:	146.4 KB ID:	764772Click image for larger version  Name:	image_8698.png Views:	1 Size:	181.2 KB ID:	764773Click image for larger version  Name:	image_8697.png Views:	1 Size:	34.4 KB ID:	764774



                Comment


                • #9
                  Hi all,


                  V 0.9.8.1 is online (still beta) - some minor improvements, you can do now what Bud described above for tab controls - thanks for posting



                  @Israel,

                  my Visual Designer is for PB, currently it cannot do everything you can do with the one you mentioned, but it can do a lot. Give it a try and tell me what is missing.


                  JK

                  Comment


                  • #10
                    Concerning tab controls:

                    An option you rarely see is the ability to disable certain tabs. (very handy if some users need to get only limited access to the program)
                    Example has tabs 1,2, and 7 disabled...

                    Code:
                    '==================================================================================================
                    ' Example of Ownerdraw Tab control with disable tab possibility.
                    ' Tabs have icons. Disabled tabs are drawn shaded. Enabled tab with focus is drawn hilited
                    ' and raised for visual effect.
                    '==================================================================================================
                    #Compile Exe
                    #Dim All
                    
                    #Include "win32api.inc"
                    #Include "commctrl.inc"
                    #Include "comdlg32.inc"
                    
                    %DIALOG_W = 400 : %DIALOG_H = 280  : %MAXTABS = 7
                    %USR = %WM_User + 1024  :  %IDC_TAB = %USR + 102
                    
                    'Type TCDataType
                    '  szText    As Asciiz * 32
                    '  hIcon     As Dword
                    '  hTab      As Dword
                    'End Type
                    
                    Global lTCI As TC_ITEM, TabState, hIcon(), hTab, hDlg() As Dword
                    Global TabText() As AsciiZ * 32
                    
                    '----------------------------------------------------------------------------------------------------------------------
                    Function WinMain (ByVal CurInst&, ByVal PrvInst&, ByVal CmdLine As AsciiZ Ptr, ByVal CmdShow&) Export As Long
                    
                      Dim TabText(%MAXTABS) As Global AsciiZ * 32
                      Dim hIcon (%MAXTABS) As Dword, hDlg(%MAXTABS) As Dword
                    
                      TabState = &B000001000011                                                 'Disabled Tabs mask - Disabled if set
                    
                      InitCommonControls
                      Local Icc As Init_Common_ControlsEx
                      Icc.dwSize = SizeOf(Icc)
                      Icc.dwIcc = %ICC_TAB_CLASSES
                      InitCommonControlsEx Icc
                    
                      Global hInstance As Long
                      hInstance = CurInst&
                    
                      hIcon( 0)     = LoadIcon(ByVal 0, ByVal %IDI_APPLICATION)                 '
                      CreateDialog0
                    End Function
                    
                    '======================================================================================================================
                    ' Main dialog and tab control creation
                    '----------------------------------------------------------------------------------------------------------------------
                    Function CreateDialog0() As Long
                      Local lCnt As Long
                      Dialog New 0, "Tab control - Ownerdraw example",,,%DIALOG_W, %DIALOG_H, _ 'Main dialog window
                                     %WS_Visible Or %WS_SysMenu Or %WS_MinimizeBox  To hDlg(0)  '
                      Control Add "SysTabControl32", hDlg(0),%IDC_TAB, "",5,5,%DIALOG_W -15, _  'Tab control
                                     %DIALOG_H - 45, %WS_Child Or %WS_Visible Or _              '
                                     %TCS_FixedWidth Or %TCS_OwnerDrawFixed                     '
                      Control Handle hDlg(0), %IDC_TAB To hTab                                  '
                      TabCtrl_SetItemSize hTab, 100, 20                                         'Set tab size
                    
                      For lCnt = 1 To %MAXTABS                                                                     '
                        CreateTabDialog(lCnt)                                                             'Create tab dialogs
                      Next lCnt
                      SetWindowPos hTab, %HWND_BOTTOM, 0,0,0,0, %SWP_NOMOVE Or %SWP_NOSIZE      'Prevents redraw problems
                      Dialog Show Modal hDlg(0), Call Dialog0_Callback                          '
                    End Function
                    
                    '----------------------------------------------------------------------------------------------------------------------
                    CallBack Function Dialog0_Callback ()
                      Local lPnmh As NmHdr Ptr,lDISPtr As DRAWITEMSTRUCT Ptr,Pt As PointAPI
                      Local TCHit As TC_HITTESTINFO, TCK As TC_KEYDOWN Ptr, Cnt As Long
                      Static CurrentTab As Long, NextTab As Long, LastKey As Dword, Rc As RECT
                    
                      Select Case CbMsg
                        Case %WM_DrawItem                                                           'Handle drawing
                          lDisPtr = CbLParam                                                        'Get tab info ptr
                          TabCtrl_GetItemRect hTab, @lDisPtr.ItemId, Rc                             'Get tab area size
                          If Bit (TabState,@lDisPtr.ItemId) Then                                    'Is tab disabled?
                            SetTextColor @lDisPtr.hDc, RGB(75, 75, 75)                              'Yes!
                            TextOut @lDisptr.hDc, Rc.nLeft + 20 + 4, Rc.nTop + 3 + 2, _             'Let icon and text
                                    TabText(@lDisPtr.ItemId + 1), Len(TabText(@lDisPtr.ItemId + 1)) 'appear shaded...
                            SetBkMode @lDisPtr.hDc, %TRANSPARENT                                    '
                            SetTextColor @lDisPtr.hDc, RGB(225,225,225)                             '
                            TextOut @lDisptr.hDc, Rc.nLeft + 21 + 4, Rc.nTop + 4 + 2, _             '
                                    TabText(@lDisPtr.ItemId + 1), Len(TabText(@lDisPtr.ItemId + 1)) '
                            DrawState @lDisPtr.hDc,ByVal 0,ByVal 0, hIcon(@lDisPtr.ItemId + 1), _   '
                                      ByVal 0, Rc.nLeft + 4, Rc.nTop + 2, 16, 16, _                 '
                                      %DST_ICON Or %DSS_DISABLED Or %DSS_UNION                      '
                            SetBkMode @lDisPtr.hDc, %OPAQUE
                          Else                                                                      'Tab is enabled
                            If @lDisPtr.ItemState = %ODS_SELECTED Then                              'If it has focus,
                              rc.nBottom = rc.nBottom + 4                                           'draw icon/text raised
                              FillRect @lDisPtr.hDC, rc, GetStockObject(%WHITE_BRUSH)              'and with hilited color
                              rc.nBottom = rc.nBottom - 4                                           '
                              SetBkColor @lDisPtr.hDc, RGB (255, 255, 255)                          '
                              SetTextColor @lDisPtr.hDc, RGB (0, 0, 255)                            '
                              Rc.nLeft = Rc.nLeft + 3                                               '
                            Else                                                                    'Else draw normal
                              SetTextColor @lDisPtr.hDc, RGB (0, 0, 0)                              '
                              Rc.nLeft = Rc.nLeft + 4 : Rc.nTop = Rc.nTop + 2                       '
                            End If                                                                  '
                            DrawIconEx @lDisPtr.hDc, Rc.nLeft, Rc.nTop, _                           '
                                       hIcon(@lDisPtr.ItemId + 1), 16, 16, 0, 0, %DI_NORMAL         '
                            TextOut @lDisptr.hDc, Rc.nLeft + 20, Rc.nTop + 2, _                     '
                                    TabText(@lDisPtr.ItemId + 1), Len(TabText(@lDisPtr.ItemId + 1)) '
                          End If                                                                    '
                          Function = 1                                                              '
                        Case %WM_Notify                                                             '
                          lPnMh = CbLParam                                                          '
                          If @lPnMh.IdFrom = %IDC_TAB Then                                          'Message from tabctrl?
                            Select Case @lPnMh.Code                                                 'see what's up...
                              Case %TCN_SelChanging                                                 'About to change Tabs..
                                GetCursorPos Pt                                                     'Get cursor position
                                ScreenToClient hTab, Pt                                             'on tab.
                                TCHit.Pt = Pt                                                       'Save position
                                CurrentTab = TabCtrl_GetCursel (hTab)                               'Requested new tab
                                Select Case LastKey                                                 'See if caused by a
                                  Case %VK_LEFT                                                     'keypress...
                                    Cnt = CurrentTab - 1                                            'If so, change tabs
                                    If Cnt >= 0 Then                                                'accordingly
                                      For Cnt = Cnt To 0 Step -1                                    '
                                        If (Bit(Tabstate, Cnt) = 0) Then                            '
                                          NextTab = Cnt                                             '
                                          Exit For                                                  '
                                        End If                                                      '
                                      Next                                                          '
                                    End If                                                          'Make sure disabled
                                  Case %VK_RIGHT                                                    'tabs are skipped
                                    Cnt = CurrentTab + 1                                            '
                                    If Cnt < %MAXTABS Then                                          '
                                      For Cnt = Cnt To %MAXTABS -1                                  '
                                        If (Bit(Tabstate, Cnt) = 0) Then                            '
                                          NextTab = Cnt                                             '
                                          Exit For                                                  '
                                        End If                                                      '
                                      Next                                                          '
                                    End If                                                          '
                                  Case %VK_HOME                                                     '
                                    For Cnt = 0 To %MAXTABS -1                                      '
                                      If (Bit(Tabstate, Cnt) = 0) Then                              '
                                        NextTab = Cnt                                               '
                                        Exit For                                                    '
                                      End If                                                        '
                                    Next                                                            '
                                  Case %VK_END                                                      '
                                    For Cnt = %MAXTABS -1 To 0 Step -1                              '
                                      If (Bit(Tabstate, Cnt) = 0) Then                              '
                                        NextTab = Cnt                                               '
                                        Exit For                                                    '
                                      End If                                                        '
                                    Next                                                            '
                                  Case Else         : NextTab = TabCtrl_Hittest (hTab,TcHit)        'Mouseclick, get tab
                                End Select                                                          '
                                If (NextTab<0) Or (NextTab>%MAXTABS) Then NextTab = CurrentTab      'Reject if invalid
                                If Bit(Tabstate, NextTab) Then                                      'Tab is disabled...
                                  WinBeep 800,20                                                    '
                                  LastKey = 0                                                       '
                                  Function = 1                                                      '
                                End If                                                              '
                              Case %TCN_SelChange                                                   'Tab has changed
                                Dialog Show State hDlg(CurrentTab +1), %SW_Hide                     'Disable/enable dialogs
                                Dialog Show State hDlg(NextTab +1), %SW_Show                        '
                                If TabCtrl_GetCurSel(hTab) <> NextTab Then                          'Adjust tab if needed
                                  TabCtrl_SetCurSel hTab, NextTab                                   '(happens if Home/End
                                End If                                                              'pressed and first/last
                                LastKey = 0                                                         'tab is disabled)
                              Case %TCN_KeyDown                                                     '
                                TCK = CbLParam                                                      'Save last keypress
                                LastKey = @TCK.wvKey                                                '
                            End Select                                                              '
                          End If                                                                    '
                        Case %WM_SYSCOMMAND                                                         'Disable screensaver
                          If CbWParam = %SC_ScreenSave Then Function = 1                            '
                      End Select
                    End Function
                    
                    '==================================================================================================
                    ' Dialog on tabs
                    '--------------------------------------------------------------------------------------------------
                    Function CreateTabDialog(ByVal pDlg As Long) As Long
                      CreateTabWindow pDlg, "Tab " & Format$(pDlg) & ":"
                      hIcon(pDlg)     = LoadIcon(ByVal 0, ByVal %IDI_APPLICATION+pDlg)              '
                      Dialog Show Modeless hDlg(pDlg)
                    End Function
                    
                    '==================================================================================================
                    ' Creates a template Tab window and adds it to the Tab control
                    '--------------------------------------------------------------------------------------------------
                    Function CreateTabWindow(ByVal htWin As Dword, sText As String) As Dword
                      Local Rc As Rect
                      TabText(htWin) = sText
                      Dialog New hDlg(0), TabText(htWin), 10, 5, %DIALOG_W-50, %DIALOG_H-45, _  'Create tab dialog
                                          %WS_Visible Or %WS_Child To hDlg(htWin)               '
                      lTCI.mask    = %TCIF_Text                                                 '
                      lTCI.pszText = VarPtr (TabText(htWin))                                    '
                      TabCtrl_InsertItem  hTab, htWin -1, lTCI                                  'Add to tabcontrol
                      GetClientRect hDlg(0), Rc                                                 'Resize dialog window
                      InflateRect Rc, -25 , -60                                                 'and move it into
                      OffsetRect  Rc, -9 , -25                                                  'position
                      MoveWindow hDlg(htWin), Rc.nLeft, Rc.nTop, Rc.nRight, Rc.nBottom, %True   '
                      Dialog Show State hDlg(htWin), %SW_Hide                                   'Default hided
                    End Function
                    
                    '==================================================================================================
                    Regards,
                    Peter

                    Comment


                    • #11
                      Hi Peter,


                      i will think about it...


                      V 0.9.8.2 is out


                      JK

                      Comment


                      • #12
                        Hi Peter,


                        V 0.9.8.3 has an implementation of what you wanted, please read in the help Visual Designer\JK_VD\Controls\Tab


                        JK

                        Comment


                        • #13
                          Hey Juergen,

                          I finally had some time to download your new VD (v0.9.8.4) to test it. Unfortunately, probably due to my environment, it appears to not work as expected. I only see the dialog canvas (see attached picture below.) but no tools to add controls or even a menu to save, load, etc. I also have no way to close the app except to kill the process from Task Manager.

                          To help better explain my Dev environment, I have 6 monitors laid out as follows...

                          Code:
                          [FONT=courier new]+-----+ +-----+ +-----+
                          |  1  | |  2  | |  3  |
                          +-----+ +-----+ +-----+
                          
                          +-----+ +-----+ +-----+
                          |  4  | |  5  | |  6  |
                          +-----+ +-----+ +-----+[/FONT]
                          Monitor 5 is the default monitor
                          Monitor 1 is where I have StarDock Fences organize my icons


                          When I run jk_vd.exe this is what I see...
                          Attached Files
                          Last edited by George Bleck; 17 Sep 2017, 11:06 AM.
                          <b>George W. Bleck</b>
                          <img src='http://www.blecktech.com/myemail.gif'>

                          Comment


                          • #14
                            Hi George,


                            thanks for testing!

                            You cannot run "jk_vd.exe" as a standalone .exe, you must run it from the IDE (jk-ide.exe) and you must create a visual designer file in the IDE first. Go to the IDE´s main menu -> File/New As/Visualdesigner File (standalone) and create such a file, then press "F7". The Visual Designer should pop up and fill the monitor where the IDE currently is. There is a help file for the IDE and the VD, main menu -> Help/JK-IDE Help, this should answer your questions. If some topic isn´t covered, or isn´t covered enough, please let me know.

                            If you experience further trouble or find bugs, please post it here or drop me a mail (jk-ide at t minus online dot de). Currently there is a drawing bug in the context menu, but there will be an update soon.

                            If you check "Look for Online Updates" in Editor Options (main menu -> Options/Editor...) the IDE looks for updates once a day and downloads and installs the latest version.


                            JK

                            Comment


                            • #15
                              Hi all,


                              V 0.9.8.5 is online - fixed a bug in VD, the contextmenu was not properly drawn, some minor issues


                              JK

                              Comment


                              • #16
                                Just came to the forum to ask a question, and found this thread. I just updated my copy of JK-IDE, and I see a new subdirectory for "VisualDesigner", so I presume I don't have to install anything, but I figure I'd better ask some basic questions:


                                - What do I need to do to ensure the Designer is installed?
                                - How do I invoke it?
                                - Can it import and use a Firefly project?

                                Looking forward to giving it a good workout!

                                -John

                                Comment


                                • #17
                                  Hi John,


                                  thanks for your interest.

                                  As usual you don´t have to go through an installation process, just unpack the .zip to wherever you want or update with the automatic update feature - that´s it.

                                  You cannot run "jk_vd.exe" as a standalone .exe, you must run it from the IDE (jk-ide.exe) and you must create a visual designer file in the IDE first. Go to the IDE´s main menu -> File/New As/Visualdesigner File (standalone) and create such a file, then press "F7".

                                  Currently you cannot import Firefly projects

                                  There is a help file for the IDE and the VD, main menu -> Help/JK-IDE Help, this should answer your questions. If some topic isn´t covered, or isn´t covered enough, please let me know.


                                  JK

                                  Comment

                                  Working...
                                  X