• Welcome to PlanetSquires Forums.
 

Requests for sticky Post

Started by Petrus Vorster, September 29, 2022, 09:06:01 AM

Previous topic - Next topic

Petrus Vorster

Hi Paul

This may be a lot to ask for:

Automatic divider lines between functions / subs is a great tool.
Collapsible code blocks with a [-] or
  • under that divide with just the function/sub name.

In other words you can see all your functions and subs in a few lines, and expand or collapse the section you are working with with a single click.

And if you are really in the mood: A visual Printer layout tool for reports or general quick page creations. e.g. You Set up your page in the page designer, set fonts with a dropdown and mark the places for data from your app.
Then output to printer, pdf etc on the go with just a click.
Like a simplified crystal report type concept. (A lot to ask for!)

Thank you for all your hard work!!

Regards,

Peter!
-Regards
Peter

Paul Squires

Quote from: Petrus Vorster on September 29, 2022, 09:06:01 AMAutomatic divider lines between functions / subs is a great tool.
Collapsible code blocks with a [-] or
  • under that divide with just the function/sub name.
In other words you can see all your functions and subs in a few lines, and expand or collapse the section you are working with with a single click.


  • Adding a divider line may not be possible because I don't believe that the Scintilla editing control can easily accommodate such a feature.

Not sure if you are aware but you can activate code folding (to show/hide subs/functions) via "File", "Preferences", "Environment Options", "Code Editor", "Show fold margin". You can then use the various fold commands found under the "View" main menu.

QuoteAnd if you are really in the mood: A visual Printer layout tool for reports or general quick page creations. e.g. You Set up your page in the page designer, set fonts with a dropdown and mark the places for data from your app.
Then output to printer, pdf etc on the go with just a click.
Like a simplified crystal report type concept. (A lot to ask for!)
That would be a huge amount of work. :)  At best, I could probably create a print library that could make working with creating document easier, or maybe even a Print Preview type of control. I had started work on such a control a year or two ago for a personal project.



Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Petrus Vorster

 ;D

I remember back in VB6, instead of some grand paper designer, someone made a form dialogue with no borders.
You just needed to adjust the form measurements for A4 / American beforehand. It was not really flexible but you could set up a page with just the variables to be added. Then use a formprint to print it.
Redneck design, but it worked..... :)

I am always grateful for what you do. Great stuff!

-Peter
-Regards
Peter

philbar

Hi Paul,

I may be looking ahead to Ver. 3.03 here, given that you already have a well-developed to-do list, but here goes:

I think a couple of valuable additions to the toolbox would be (1) what some design systems call a Canvas control (based on Cgraphctx) and (2) a matching Printer control (based on Cprint, obviously).

As I see it, the Canvas would have properties to remember the current pen, brush, font, and transformation matrix, and methods to do the elementary drawing and printing functions. Draw the graph, print the text and stick the company logo at the top. There's a boatload of methods and associated objects for the Cgpgraphics object, and for the more advanced ones I recommend a pointer to the appropriate page in the WinFBX manual.

The Printer control would have all the same properties and methods, and so you could use the identical commands to print on paper that you used to draw on the screen.

With those two tools, maybe we don't need a report generator--or maybe some enterprising user would be willing to take that on as a project. Also, I could do my stuff with a lot less referring to my notes.

Phil

Petrus Vorster

Hi All

Paul, it is impressive to follow the updates and changes you make, and the speed you are doing it with!

Something that i would use a great deal is a TAB control where one can hide the TABS and programmatically change the pages.
I know this had come up many times over the years even in Powerbasic.

I dont have the vaguest skills to even attempt a new control design, but with the impressive skills of everyone else on this forum, it may just become a reality!

If there is a place for something on a wishlist, then please add this one!!

Regards,

Peter
-Regards
Peter

Paul Squires

Quote from: philbar on October 04, 2022, 12:34:19 PMI think a couple of valuable additions to the toolbox would be (1) what some design systems call a Canvas control (based on Cgraphctx) and (2) a matching Printer control (based on Cprint, obviously).

Hi Phil, sorry I must have missed this post when you posted it last week. I have added both a canvas control and a print control to my list (not the sticky post) because I am not confident that I would be able to get these done before release of version 3.02. You are not the first person to suggest a canvas type of control. I will admit though that it is something that I have never had a reason to use in the past so it will take me some time to understand and implement.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Quote from: Petrus Vorster on October 10, 2022, 04:21:16 AMSomething that i would use a great deal is a TAB control where one can hide the TABS and programmatically change the pages.

Hi Peter,

I don't think that a TAB control is the right tool for this job. The scenario you propose is something that I do all the time in my programs BUT I do not use a Tab control for it.

I create one or more (as needed) Forms but set the ChildForm property to TRUE. You can then use that child form as a container to place and design all of your controls and when you show/hide that form itself then all of the controls on that form will show/hide.

This is essentially how the Tab control works with the big difference of course is that the tab control has the visual tabs that you can click. However, if you have no need to be clicking the tabs or want to change tabs programmatically, then using my ChildForm method is much easier to implement and have control over.

If you look at a dialog like the "Environment Options" in WinFBE, you will see that this is the technique that I use. When you click on a branch in the treeview then a different ChildForm displays in the right hand pane of the dialog.

Do you understand when I am trying to explain? It is kind of hard to explain in a post. I can create a simple test project showing this if you wish.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Petrus Vorster

Hi Paul

Yes, we did it in Powerbasic with multiple forms indeed.
I still have working applications that used that.

Since i dont make huge apps, the tabcontrol works perfectly, but I like to put nice buttons for the users. It's ok.

You wont perhaps post a Freebasic example of the childforms placement like we did in PB?
Some of the old code was:

MapWindowPoints HWND_form1_frame1, HWND_FORM1, rc, 2
currentform = myform

SetWindowPos mycontrol, 0, _
   rc.nLeft + AfxScaleX(2), rc.nTop + AfxScaleY(8), _
   rc.nRight - rc.nLeft - AfxScaleX(2), rc.nBottom - rc.nTop - AfxScaleY(12), _
   %SWP_NOZORDER Or %SWP_NOZORDER Or %SWP_SHOWWINDOW


End Function

I am not yet able to translate all of ths the FB.

THanks a million

Peter
-Regards
Peter

Paul Squires

Hi Peter,

I have created a simple example program. I can't post it as an attachment because it is written in the version 3.02 of the Visual Designer which none of you folks have yet. However, I can post the code portion of the project because that will work in your version.

You just need to:
(1) Create a visual designer project.
(2) Add 3 additional forms (call them Panel1, Panel2, Panel3).
(3) Set the ChildForm property to True for each of the new panels.I also set each Form's BackColor to a different color so that you can see it on the screen and know that it is working correctly.
(4) Add a ListBox to the left hand side of frmMain. Enable the Click event.
(5) #Include Once "Panel1.inc" to your project's main file.
(5) #Include Once "Panel2.inc" to your project's main file.
(5) #Include Once "Panel3.inc" to your project's main file.

Here is the code for frmMain.inc. Remember to enable these Events: Load, Resize.

' frmMain form code file

dim shared gActivePanel as long = 0

''
''
function frmMain_PositionWindows() as long
   
   ' Move all of the panels into position regardless of whether they are
   ' hidden or shown.
   dim as long nMargin = 10
   
   ' Set the sizes of child forms based on the position of the listbox
   ' and the current size of frmMain.
   ' Align the top of the child forms to the top of the listbox
   dim as long nTop =  frmMain.List1.Top
   dim as long nLeft = frmMain.List1.Left + frmMain.List1.Width + nMargin
   dim as long nWidth = frmMain.ClientSize.Width - nLeft - nMargin
   dim as long nHeight = frmMain.ClientSize.Height - nTop - nMargin
   
   Panel1.SetBounds( nLeft, nTop, nWidth, nHeight )
   Panel2.SetBounds( nLeft, nTop, nWidth, nHeight )
   Panel3.SetBounds( nLeft, nTop, nWidth, nHeight )
   
   ' Show/Hide the active/non-active Panel
   Panel1.Hide: Panel2.Hide: Panel3.Hide
   select case gActivePanel
      case 0:  Panel1.ShowChild( frmMain )
      case 1:  Panel2.ShowChild( frmMain )
      case 2:  Panel3.ShowChild( frmMain )
   end select
   
   return 0
end function


''
''
Function frmMain_List1_Click( ByRef sender As wfxListBox, ByRef e As EventArgs ) As LRESULT
   gActivePanel = frmMain.List1.SelectedIndex
   frmMain_PositionWindows()
   Function = 0
End Function

''
''
Function frmMain_Resize( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   frmMain_PositionWindows()
   Function = 0
End Function

''
''
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   ' Load the ListBox options
   frmMain.List1.Items.Add( "Show Panel 1" )
   frmMain.List1.Items.Add( "Show Panel 2" )
   frmMain.List1.Items.Add( "Show Panel 3" )
   frmMain.List1.SelectedIndex = 0
   Function = 0
End Function




Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Hi Peter,

I have uploaded Beta-1 version of the new visual designer so you can use that WinFBE to load the attached visual designer project that shows how to do the show/hide child forms stuff.

Here is the Beta-1 post: https://www.planetsquires.com/protect/forum/index.php?topic=4661.0

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Petrus Vorster

Thank you Paul.

This example is much simpler that all the scaling conversions in Powerbasic.
everything you guys had put into the Freebasic designer is coming together nicely.

All I need is a project!

Nice to see all this!

-Peter
-Regards
Peter

Petrus Vorster

This works incredibly well.
And so simple to implement.

-Peter
-Regards
Peter