Page 8 of 103

Posted: Fri Sep 15, 2006 1:54 pm
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).

Posted: Fri Sep 15, 2006 2:07 pm
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:

Posted: Fri Sep 15, 2006 3:03 pm
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:

Posted: Fri Sep 15, 2006 3:03 pm
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

Posted: Fri Sep 15, 2006 3:22 pm
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 ...

Posted: Fri Sep 15, 2006 3:23 pm
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 ...

Posted: Fri Sep 15, 2006 11:24 pm
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

Posted: Sat Sep 16, 2006 7:50 am
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.

Posted: Sat Sep 16, 2006 8:34 am
by gnozal
Update

Changes :
- some fixes
- added : SplitterGadget ; you can now specify the splitter position.

Posted: Sat Sep 16, 2006 8:53 am
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.

Posted: Sat Sep 16, 2006 9:13 am
by nicolaus
@gnozal

Add this image you can see wat i mean:

Image

regards,
Nico

Posted: Sat Sep 16, 2006 9:14 am
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

Posted: Sat Sep 16, 2006 9:28 am
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:

Posted: Sat Sep 16, 2006 9:32 am
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.

Posted: Sat Sep 16, 2006 9:44 am
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.