PureFORM 1.99 (yet another FORM designer)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

@gnozal

Ok here is the project (copy and past from PureFORM)

Code: Select all

;{[PureFORM Project]
;PureFORM_Project_Begin
;Project¶PureFORM_Clipboard2
;Window¶1¶#Window_0¶13500416¶#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar¶#Window_0¶450¶200¶400¶400¶0¶10¶10¶0¶5000¶5000¶0¶-1¶1¶
;ContainerGadget¶1¶#ContainerGadget_0¶1¶-1¶-1¶0¶0¶5¶0¶2¶#PB_Container_Raised¶¶¶-1¶0¶¶¶0¶0¶1¶0¶0¶0¶0¶390¶396¶0¶0¶0¶0¶0¶0¶0¶-1¶-1¶-1¶-1¶¶0¶¶0¶0
;PureFORM_Project_End
;}
regards,
Nico
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

nicolaus wrote:Ok here is the project (copy and past from PureFORM)
Sorry, I meant YOU to import MY project, and to see if the problem happens.
I have imported your project, and I see that the container is over the statusbar, because of his height = 396 (for a window with height = 400) : this is to much. Once the container height corrected to 380, it resizes without a problem with PureRESIZE enabled (Preview or Compile/Run).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

yes i know it is to hieght but if you do the same in delphi or VisualStudio you cant set the container over the statusbar.
I mean that you can´t give a height more than the windowheight - statusbarheight for a gadget.

This is not a bug from PureForm, it is a bug from PB that we can set a Gadget over the Statusbar, but you can intern in PureFORM look add the height of the Gadgets, and if this hieght more than the height of the Window - Statusbarheight you set the height of the Gadget smaller.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

nicolaus wrote:yes i know it is to hieght but if you do the same in delphi or VisualStudio you cant set the container over the statusbar.
I mean that you can´t give a height more than the windowheight - statusbarheight for a gadget.

This is not a bug from PureForm, it is a bug from PB that we can set a Gadget over the Statusbar, but you can intern in PureFORM look add the height of the Gadgets, and if this hieght more than the height of the Window - Statusbarheight you set the height of the Gadget smaller.
Ah, now I think I understand !
In PureFORM it is hard to resize the container with the mouse over the statusbar because the mouse cursor is clipped, but you can resize it with the spingagdets as you like.
I think it's the programmer's responsibility to check if he draws a too big gadget, it's not that hard to see ... And it may even be intentional !
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
FreeThought
User
User
Posts: 54
Joined: Mon Jul 18, 2005 10:28 am

Post by FreeThought »

Thanks gnozal for the well done coding, but I have small problem, font setup(enabled) has no effect when purecolor is enabled.
Note:
the code works fine if I use purecolor after font setup in the purebasic editor..


Regards.
Last edited by FreeThought on Sun Sep 17, 2006 5:32 pm, edited 1 time in total.
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

one more bug :wink:

Here is the project :
;{[PureFORM Project]
;PureFORM_Project_Begin
;Project¶PureFORM_Clipboard2
;Window¶1¶#Window_0¶349110275¶#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#PB_Window_MaximizeGadget¶#Window_0¶335¶47¶665¶555¶0¶10¶10¶0¶5000¶5000¶0¶-1¶1¶
;TreeGadget¶1¶#tree_forms¶1¶-1¶-1¶0¶0¶28¶0¶32¶#PB_Tree_AlwaysShowSelection¶¶¶-1¶3¶¶¶0¶0¶0¶0¶0¶0¶0¶0¶0¶1¶1¶1¶0¶0¶0¶0¶-1¶-1¶-1¶-1¶¶0¶¶0¶0
;TreeGadget¶2¶#tree_gadgets¶1¶-1¶-1¶0¶0¶28¶0¶32¶#PB_Tree_AlwaysShowSelection¶¶¶3¶3¶¶¶0¶0¶0¶0¶0¶0¶0¶0¶0¶1¶1¶1¶0¶0¶0¶0¶-1¶-1¶-1¶-1¶¶0¶¶0¶0
;SplitterGadget¶3¶#plitt_left¶1¶-1¶-1¶0¶0¶24¶220¶2¶#PB_Splitter_Separator¶¶¶2¶5¶#tree_forms¶#tree_gadgets¶1¶2¶0¶0¶0¶0¶0¶0¶0¶1¶1¶1¶0¶0¶0¶0¶-1¶-1¶-1¶-1¶¶0¶¶0¶0
;ScrollAreaGadget¶4¶#scrl_haupt¶1¶-1¶-1¶0¶0¶21¶0¶1¶#PB_ScrollArea_Flat¶¶¶5¶5¶440¶515¶440¶515¶1¶0¶0¶0¶0¶0¶0¶1¶1¶1¶1¶1¶0¶0¶-1¶-1¶-1¶-1¶¶0¶¶0¶0
;SplitterGadget¶5¶#splitt_haupt¶1¶-1¶-1¶0¶0¶24¶175¶3¶#PB_Splitter_Separator|#PB_Splitter_Vertical¶¶¶4¶0¶#plitt_left¶#scrl_haupt¶3¶4¶0¶0¶0¶0¶0¶665¶535¶1¶1¶1¶1¶1¶0¶0¶-1¶-1¶-1¶-1¶¶0¶¶0¶0
;PureFORM_Project_End
;}
In the proberty off the splitt_left you can see that i have set a Splitt position at 220.

But if you Compile / Run you see that the Splittposition is alltimes 0

[Edit]
and it the example project you can find one more prob.
If you open the Project you can´t press right mouse button in the window for the menu, to add a menu or statusbar or so.
Any way to add a menu to a Window if i have the gadgets over all the window width / height?
[/Edit]

regards,
Nico
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

nicolaus wrote:In the proberty off the splitt_left you can see that i have set a Splitt position at 220.
But if you Compile / Run you see that the Splittposition is alltimes 0
Seems like a PB issue : when you create the second splitter with the first splitter, it seems to reset the first splitter position.
You have to move the SetGadgetState() function :

Code: Select all

;{- Constants
;{ Windows
Enumeration
  #Window_0
EndEnumeration
;}
;{ Status bars
Enumeration
  #StatusBar_Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
  #tree_forms
  #tree_gadgets
  #plitt_left
  #scrl_haupt
  #splitt_haupt
EndEnumeration
;}
;}
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 288, -10, 665, 555, #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#PB_Window_MaximizeGadget, "#Window_0")
    If CreateStatusBar(#StatusBar_Window_0, WindowID(#Window_0))
    EndIf
    If CreateGadgetList(WindowID(#Window_0))
      TreeGadget(#tree_forms, 0, 0, 0, 0, #PB_Tree_AlwaysShowSelection)
      TreeGadget(#tree_gadgets, 0, 0, 0, 0, #PB_Tree_AlwaysShowSelection)
      SplitterGadget(#plitt_left, 0, 0, 0, 0, #tree_forms, #tree_gadgets, #PB_Splitter_Separator)
      ;SetGadgetState(#plitt_left, 220) 
      ScrollAreaGadget(#scrl_haupt, 0, 0, 0, 0, 440, 515, 10, #PB_ScrollArea_Flat) ;>
      CloseGadgetList() ;<
      SplitterGadget(#splitt_haupt, 0, 0, 665, 535, #plitt_left, #scrl_haupt, #PB_Splitter_Separator|#PB_Splitter_Vertical) ; resets first splitter position !
      SetGadgetState(#splitt_haupt, 175)
      SetGadgetState(#plitt_left, 220) ; <----- moved here
      ; Gadget Resizing
      PureRESIZE_SetGadgetResize(#tree_forms, 1, 1, 0, 0)
      PureRESIZE_SetGadgetResize(#tree_gadgets, 1, 1, 0, 0)
      PureRESIZE_SetGadgetResize(#plitt_left, 1, 1, 0, 0)
      PureRESIZE_SetGadgetResize(#scrl_haupt, 1, 1, 1, 1)
      PureRESIZE_SetGadgetResize(#splitt_haupt, 1, 1, 1, 1)
    EndIf
  EndIf
EndProcedure

OpenWindow_Window_0()

;{- Event loop
Repeat
  Event = WaitWindowEvent()
  Select Event
    ; ///////////////////
    Case #PB_Event_Gadget
      EventGadget = EventGadgetID()
      EventType = EventType()
      If EventGadget = #tree_forms
      ElseIf EventGadget = #tree_gadgets
      ElseIf EventGadget = #plitt_left
      ElseIf EventGadget = #scrl_haupt
      ElseIf EventGadget = #splitt_haupt
      EndIf
      ; //////////////////////
    Case #PB_Event_CloseWindow
      EventWindow = EventWindowID()
      If EventWindow = #Window_0
        Break
      EndIf
  EndSelect
ForEver
;}
nicolaus wrote:and it the example project you can find one more prob.
If you open the Project you can´t press right mouse button in the window for the menu, to add a menu or statusbar or so.
Any way to add a menu to a Window if i have the gadgets over all the window width / height?
You are right !
I will add some emnu items in the main menu.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

FreeThought wrote:Thanks gnozal for the well done coding, but I have small problem, font setup(enabled) has no effect when purecolor is enabled.
Yes, you are right. Some gadgets (like buttons) need to first set font and after set color.
I will change the order in the generated code.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

Ok one more question:

If i delete a SplitterGadget the 2 gadgets inside the Splitter will also delete.
Is it poible to change this, so taht only the Splittergadget deleted but NOT the 2 gadgets insdie the SplitterGadget?

And can you add a option to change a gadget inside a splittergadget?

Thanks and regards,
Nico
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

Changes :
- added : you can now access to the PureFORM window context menu in each PureFORM window via the system menu
- changed : generated code ; the font section is placed before the PureCOLOR section
- changed : generated code ; the splitter positions are now set at the end of the code, before the extra sections
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

nicolaus wrote:Ok one more question:
If i delete a SplitterGadget the 2 gadgets inside the Splitter will also delete.
Is it poible to change this, so taht only the Splittergadget deleted but NOT the 2 gadgets insdie the SplitterGadget?
And can you add a option to change a gadget inside a splittergadget?
Actually, the two elements of a splittergadget can't be changed (I have experienced to much problems ; in PB3.94, you can't replace a gadget in a splitter with SetGadgetAttribute()). However, you can use the undo feature if you made a mistake.
The other gadgets, childs of a splitter element, can be processed like any other gagdet in PureFORM.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
FreeThought
User
User
Posts: 54
Joined: Mon Jul 18, 2005 10:28 am

Post by FreeThought »

Thanks gnozal for the update, truely appreciated.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

Changes :
- added : direct gadget group selection with mouse (only for moving) ; add/remove gadgets with Ctrl+LeftClick (-> blue frame), then move the group (-> red frame) by moving one of the group members. The group is automatically deselected after the move (it can also be cancelled with Escape or with a left click on the current window).
You can still use the gadget group dialog : it does move / resize and alignment.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

Amazing job, as usual ! :D
congrats Image
“Fear is a reaction. Courage is a decision.” - WC
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Thanks gnozal for the update.
gnozal wrote:Update

Changes :
- added : direct gadget group selection with mouse (only for moving) ; add/remove gadgets with Ctrl+LeftClick (-> blue frame), then move the group (-> red frame) by moving one of the group members. The group is automatically deselected after the move (it can also be cancelled with Escape or with a left click on the current window).
You can still use the gadget group dialog : it does move / resize and alignment.
I'm not sure if I've done this right.. I created 2 buttons, and put both of them into a group. If I press Ctrl+LeftClick, this will drag around the group, but both buttons will only be dragged around as a group if I perform the drag on the 2nd button I created (or maybe it was the 2nd button added to the group). If I perform the drag on the first button, the group is not dragged (only the 1st button is moved).
Post Reply