Hello,
I'm trying to setup a splittergadget and it is not working as expected. I need help because I don't know how to do what I want.
Problem: I have one container which contains a text label an a text editor. I duplicate this container. So I have 2 containers with a text label and a text editor in each one. So I would like to put this 2 containers in a splittergadget verticaly. To do that, I draw a splitter choosing container_0 and container_1 and start drawing button. After I draw the splitter to encompass the 2 containers... The result is an empty splittergadget et text labels and editors out of containers.
Questions: How could I setup the splittergadget? Or how could I put text labels and editors inside containers and containers inside splittergadget after drawing the splittergadget? Can I do this using the Form Designer with mouse and without coding manually (because the source of the Form is regenerated each time making manual coding obsolete each saving the Form.pbf file) ?
Thank you in advance.
SplitterGadget whith mouse.
Re: SplitterGadget whith mouse.
The gadgets you want to be in the containers need to have their 'Parent' property set as the relevant ContainerGadget. Have you done that?
I'm not sure if the Form Designer handles resizing, but normally, when you have a ContainerGadget inside a SplitterGadget, only the ContainerGadget is resized when the splitter is moved. The gadgets inside the ContainerGadget need to be resized manually.
I'm not sure if the Form Designer handles resizing, but normally, when you have a ContainerGadget inside a SplitterGadget, only the ContainerGadget is resized when the splitter is moved. The gadgets inside the ContainerGadget need to be resized manually.
Re: SplitterGadget whith mouse.
The Form Designer "ejects" gadgets when you put a splitter around a ContainerGadget. (Bug?)
To counter this, you can do
- Make the container
- Put the gadgets (with the Parent property in the desired container)
- Trace the splitter
- Take back each gadget and give it the Parent property to the desired container, because it has been ejected from ContainerGadget.
The gadgets in the containers are well resized when the window changes size (but not when the splitter moves, which is normal)
(Tested)
To counter this, you can do
- Make the container
- Put the gadgets (with the Parent property in the desired container)
- Trace the splitter
- Take back each gadget and give it the Parent property to the desired container, because it has been ejected from ContainerGadget.
The gadgets in the containers are well resized when the window changes size (but not when the splitter moves, which is normal)
(Tested)
Re: SplitterGadget whith mouse.
All right, I am going to try this.Marc56us wrote:The Form Designer "ejects" gadgets when you put a splitter around a ContainerGadget. (Bug?)
To counter this, you can do
- Make the container
- Put the gadgets (with the Parent property in the desired container)
- Trace the splitter
- Take back each gadget and give it the Parent property to the desired container, because it has been ejected from ContainerGadget.
The gadgets in the containers are well resized when the window changes size (but not when the splitter moves, which is normal)
(Tested)
Thank you. Have nice day!
Re: SplitterGadget whith mouse.
Hello, It doesn't works because I can't choose the parent. It give me only window_0 as possible parent.Marc56us wrote:The Form Designer "ejects" gadgets when you put a splitter around a ContainerGadget. (Bug?)
To counter this, you can do
- Take back each gadget and give it the Parent property to the desired container, because it has been ejected from ContainerGadget.
The gadgets in the containers are well resized when the window changes size (but not when the splitter moves, which is normal)
(Tested)
There is another bug under linux. The text in text editor is not visual selected when selected with mouse. But Ctrl+c and Ctrl+v works fine.
Thanks for answered me
Re: SplitterGadget whith mouse.
Are you definitely trying to set the parent for the right gadget?
Is this essentially what you're trying to do? Save it as a .pbf file to open it as a form in the IDE.
Is this essentially what you're trying to do? Save it as a .pbf file to open it as a form in the IDE.
Code: Select all
; Form Designer for Purebasic - 5.71
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
Global Window_0
Global Container_0, String_0, Container_1, String_1, Splitter_0
Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu)
Container_0 = ContainerGadget(#PB_Any, 10, 10, 570, 160)
String_0 = StringGadget(#PB_Any, 0, 0, 130, 30, "")
CloseGadgetList()
Container_1 = ContainerGadget(#PB_Any, 10, 182, 570, 148)
String_1 = StringGadget(#PB_Any, 0, 0, 130, 30, "")
CloseGadgetList()
Splitter_0 = SplitterGadget(#PB_Any, 10, 10, 570, 320, Container_0, Container_1)
SetGadgetState(Splitter_0, 160)
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
Re: SplitterGadget whith mouse.
Follow the order indicated: (draw containers first)It doesn't works because I can't choose the parent. It give me only window_0 as possible parent.
1. Draw Container_0 and Container_1
2. Draw Gadget(s)
3. For each gadget, select 'Parent' (you see Container_0 and Container_1 in dialog box)
4. Draw Splitter gadget
5. Under Linux: Bug, Form Designer re-order in bad way you need to edit code
5.1 Linux Change order lines in .pbf
Code: Select all
Container_Gadget_0
...
CloseGadgetList()
Container_Gadget_1
...
CloseGadgetList()
SplitterGadget(...
Sample of edited code.
Code: Select all
Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)
OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu)
ContainerGadget(#Container_0, 20, 10, 510, 175)
EditorGadget(#Editor_0, 10, 20, 440, 90)
CloseGadgetList()
ContainerGadget(#Container_1, 20, 194, 510, 166)
ImageGadget(#Image_0, 20, 20, 420, 110, 0)
CloseGadgetList()
SplitterGadget(#Splitter_0, 20, 10, 510, 350, #Container_0, #Container_1, #PB_Splitter_Separator)
SetGadgetState(#Splitter_0, 175)
EndProcedure
If you can't access to gadget by mouse, uses tab 'Object' in panelThere is another bug under linux. The text in text editor is not visual selected when selected with mouse. But Ctrl+c and Ctrl+v works fine.
Tested on a real Linux distribution (Slackware)
Re: SplitterGadget whith mouse.
I am going to try this solution. I will let you know the result. Thanks for your idea and this information.Marc56us wrote:Follow the order indicated: (draw containers first)It doesn't works because I can't choose the parent. It give me only window_0 as possible parent.
1. Draw Container_0 and Container_1
2. Draw Gadget(s)
3. For each gadget, select 'Parent' (you see Container_0 and Container_1 in dialog box)
4. Draw Splitter gadget
5. Under Linux: Bug, Form Designer re-order in bad way you need to edit code
5.1 Linux Change order lines in .pbfYes, you can edit the order of the gadgets in the code. It will be preserved even when returning to Design View Mode.Code: Select all
Container_Gadget_0 ... CloseGadgetList() Container_Gadget_1 ... CloseGadgetList() SplitterGadget(...
Sample of edited code.After that, you can add gadget in normal way (set parent to container for each new gadget)Code: Select all
Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400) OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu) ContainerGadget(#Container_0, 20, 10, 510, 175) EditorGadget(#Editor_0, 10, 20, 440, 90) CloseGadgetList() ContainerGadget(#Container_1, 20, 194, 510, 166) ImageGadget(#Image_0, 20, 20, 420, 110, 0) CloseGadgetList() SplitterGadget(#Splitter_0, 20, 10, 510, 350, #Container_0, #Container_1, #PB_Splitter_Separator) SetGadgetState(#Splitter_0, 175) EndProcedure