PureFORM 1.99 (yet another FORM designer)

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

Moderator: gnozal

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

Post by gnozal »

ts-soft wrote:I have made a small tutorial for this, but in german, my english isn't good :oops:
No problem, I speak/read german.
ts-soft wrote:http://www.purebasic.fr/german/viewtopic.php?t=9924
I hope this helps a bit :wink:
Very interesting, thanks, but a bit complicated : a have strings and API calls everywhere ...
It would be a lot of work, and so easier if Tailbite would do this automatically !
If Tailbite is no longer updated, I suppose I will adopt your solution, but in the meantime, I'll just wait (unless I have some spare time).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Inside your lib all strings a ansi. Only if you call a api, pb uses the unicode-variant. Import all api with unicode and ansi version as ansi and all works in both :wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
chen
Enthusiast
Enthusiast
Posts: 338
Joined: Fri Dec 23, 2005 2:20 pm
Location: Quebec, Canada
Contact:

Post by chen »

gnozal wrote:
chen wrote:How could I resize two objects placed vertically in a window in a proportional way? its to say if I resize the window I want the objects dont overlap, I want the objects resize like if they were only one object.
Sorry, I don't understand what you mean ...
Create a window put a tab gadget in the upper part, place another tab
gadget below the first tab gadget.
Resize the window vertically and you will see the two tabs overlap.
to avoid this the resize of the gadgets proportional....:wink:
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

I have one more idea for the SplitterGadget.
Can you add a Gadgetoption for the Splittergadget so that we can set the position of the Splitt (in PB you do this with SetGadgerState() ) ?


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

Post by gnozal »

chen wrote:
gnozal wrote:
chen wrote:How could I resize two objects placed vertically in a window in a proportional way? its to say if I resize the window I want the objects dont overlap, I want the objects resize like if they were only one object.
Sorry, I don't understand what you mean ...
Create a window put a tab gadget in the upper part, place another tab
gadget below the first tab gadget.
Resize the window vertically and you will see the two tabs overlap.
to avoid this the resize of the gadgets proportional....:wink:
Put the two panelgadgets in a splitter, and resize the splitter ...
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:I have one more idea for the SplitterGadget.
Can you add a Gadgetoption for the Splittergadget so that we can set the position of the Splitt (in PB you do this with SetGadgerState() ) ?
regards,
nico
Ok, will see ...
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 »

And again more ideas :wink:
Can you intern delet the bug with th StatusBar from PB?
For Example:
1. create a new project
2. add a statusbar to the window (400 x 400)
3. add a containergadget to the window
4. set the pos of the container to x = 0 and y = 0 and the height = 375 and width = 400
5. set the proberty of the Container to resiz and lock all (top, left, bottom, right)
6. compile/run and you see wat i mean.

My idea is that you every time look to the position and width and height of the gadget and set automaticly the window height so taht the statusbar alltimes looks right.

I hope you know wat i mean.

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:I hope you know wat i mean.
Nope.
I created a form like you said :
;{[PureFORM Project]
;PureFORM_Project_Begin
;Project¶MyProject
;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¶400¶375¶1¶1¶1¶1¶1¶0¶0¶-1¶-1¶-1¶-1¶¶0¶¶0¶0
;PureFORM_Project_End
;}

Code: Select all

;{- Constants
;{ Windows
Enumeration
  #Window_0
EndEnumeration
;}
;{ Status bars
Enumeration
  #StatusBar_Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
  #ContainerGadget_0
EndEnumeration
;}
;}
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 400, 400, #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar, "#Window_0")
    If CreateStatusBar(#StatusBar_Window_0, WindowID(#Window_0))
    EndIf
    If CreateGadgetList(WindowID(#Window_0))
      ContainerGadget(#ContainerGadget_0, 0, 0, 400, 375, #PB_Container_Raised) ;>
      CloseGadgetList() ;<
      ; Gadget Resizing
      PureRESIZE_SetGadgetResize(#ContainerGadget_0, 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 = #ContainerGadget_0
      EndIf
    ; //////////////////////
    Case #PB_Event_CloseWindow
      EventWindow = EventWindowID()
      If EventWindow = #Window_0
        Break
      EndIf
  EndSelect
Forever
;}
I don't see what's wrong with the status bar ? Using PB3.94/NT4 though ...

On the other side, there is a bug in PureFORM : the statusbar of the first window has the same ID as the GadgetList statusbar ... Fixed for the next release. Also, I fixed a preview mode bug.
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 »

Update

Changes :
- some fixes
- added : SplitterGadget ; you can now specify the splitter position.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

When you're looking at the 'Gadget Groups' form, it seems to take over the desktop. You can't escape this form, even if you try to switch to another application, PF returns to be on top of every other application. This is not a good situation.

I've tried the 'group action' and I can see you can move a bunch of gadgets as a group, but only via a spin gadget, i.e. it is not possible to directly enter the desired x & y position into the text field next to the spin control same situation for gadget properties). This makes it very tedious to move gadgets (only using the spin control). It is much better to be able to move a group of gadgets by selecting the gadgets you want to move, and drag the group to a new position directly on the form.

In any case, it is better to enable direct editing of the position & size values instead of forcing the user to manipulate the spin controls.
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

@gnozal

Add this image you can see wat i mean:

Image

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

Post by nicolaus »

nicolaus wrote:@gnozal

Add this image you can see wat i mean:

Image

Normaly it is not true taht you can set a Gadget over the statusbar.
regards,
Nico
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

mskuma wrote:When you're looking at the 'Gadget Groups' form, it seems to take over the desktop. You can't escape this form, even if you try to switch to another application, PF returns to be on top of every other application. This is not a good situation.
Changed
mskuma wrote:I've tried the 'group action' ... It is much better to be able to move a group of gadgets by selecting the gadgets you want to move, and drag the group to a new position directly on the form.
Well, sorry, but I find this more convenient. In VD, I find it personally hard to get accurate gadget group positioning with the mouse.
Also I needed the alignment feature.
mskuma wrote:In any case, it is better to enable direct editing of the position & size values instead of forcing the user to manipulate the spin controls.
It is intended for fine tuning, but Ok, it's now optional : check 'Enable editable spingadgets' in preferences.

Hard to please everyone :wink:
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:
nicolaus wrote:@gnozal

Add this image you can see wat i mean:

Image

Normaly it is not true taht you can set a Gadget over the statusbar.
regards,
Nico
Strange, I don't get this :?:
If you use the form I posted above (copy to clipboard and use 'Load project from clipboard' in edit menu), does it also happen ? I have tested the form above in both 'Preview' and 'Compile/Run' (PB3.94 and PB4.00), and no problem.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

mskuma wrote:I've tried the 'group action' ... It is much better to be able to move a group of gadgets by selecting the gadgets you want to move, and drag the group to a new position directly on the form.
Well, sorry, but I find this more convenient. In VD, I find it personally hard to get accurate gadget group positioning with the mouse.
Also I needed the alignment feature.
For slight nudging, it may be convenient but not for major positional changes, especially as a group. It would be better if snap-to-grid movement is done (like VD) and maybe if you need to move beyond the grid, the spin control is useful. However I think you're better off nudging with the keyboard anyway (which I see is available) - it's more direct than using the mouse to use the spin control.

Here's another suggestion - if you implement detecting shift key press while dragging around a gadget, the action of pressing shift could temporarily release the snap-to-grid function. This would give the user the best of both worlds - 'snap to grid' during drag, and 'go-anywhere without snap' during shift-drag.

Anyway for individual gadget control, I guess what you currently have is ok, but for groups of gadgets, it's still very cumbersome to move these as a group. I'd suggest an operation where the user can lasso a bunch of gadgets (this process selects the gadgets) and then select any gadget to drag to the new position. This is a defacto standard method with other tools, and it works well. If that approach is not possible, the editable spin is ok but it's not as easy as the select-and-drag approach.

I see you use drag inside the window to reposition the window, but I think that's unnecessary - just reposition it by dragging the title bar area. This would enable the lasso function to be possible.
Post Reply