Anchor to sides

Post

Posted
Rating:
#1 (In Topic #555)
Trainee
 Hey there, I'm relatively new to gambas and am trying to get my applications to resize properly. I've been messing with containers but they can be a real pain sometimes and I was wondering if there was an anchor property I could set to get some objects to follow the bottom right (for example) rather than the top left that they are stuck to now. Thanks in advance!
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
cage is in the usergroup ‘Regular’
 squidink7 look in project showcase for a program written by Cedron called Resizer.  It works pretty good for most things at allowing you to resize the window and it's contents.  Cogier is one of the guys that knows the in and outs of what your asking about.  I think if you use the search on this website you find all that you are looking for.
Online now: No Back to the top

Post

Posted
Rating:
#3
Trainee
 That's great! I will probably use it in my projects from now on, so thanks for letting me know about it. However it would still be nice to have an anchor option as it serves a different use case; say you wanted all the buttons and text to stay the same size but a frame in the middle to grow in size, sort of like how dolphin handles it (or whatever file manager your desktop comes with) Plus having either that or resizer integrated by default into gambas would make it more discoverable and easy to use.
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘Guru’
The code that Cedron uses works but in most cases no code, or very little, is required. Have a look at a program I wrote to help people with this. It is on the 'Farm' or available here.

If you post your form here I will look at it and make it expandable for you.

If you are thinking VB then don't. Gambas does this in a very different way but once you get the hang of it you can do a lot.
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
sjsepan is in the usergroup ‘Regular’

squidink7 said

That's great! I will probably use it in my projects from now on, so thanks for letting me know about it. However it would still be nice to have an anchor option as it serves a different use case; say you wanted all the buttons and text to stay the same size but a frame in the middle to grow in size, sort of like how dolphin handles it (or whatever file manager your desktop comes with) Plus having either that or resizer integrated by default into gambas would make it more discoverable and easy to use.

Also have a peek at GambasGuiGeneric (https://gambas.one/gam…arm/?id=675&action=search) and the DockAnchor (https://gambas.one/gam…arm/?id=658&action=search) library it uses. These are early versions, though, and the most up-to-date copies of the DockAnchor project are on my GitHub (https://github.com/ssepan2?tab=repositories).
Downside is that it does require code, but I tried to emulate WinForms Docking/Anchoring.

To try out (that particular) project, you would need:
  1. https://github.com/ssepan2/GambasGuiGeneric
  2. https://github.com/ssepan2/DockAnchor
  3. https://github.com/ssepan2/GambasGuiAppUtilityLib
  4. https://github.com/ssepan2/GambasAppUtilityLib
  5. https://github.com/ssepan2/GambasSomeModelLib

However if you just want to read the code and see how I am using DockAnchor in the GUI app, you would only need to grab the 1st two.
To run DockAnchor, you need #2 and #4.
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Guru
cogier is in the usergroup ‘Guru’
Let me try again. Here is a video showing a Gambas form expanding. Note that there is no code created to do this, it is all done inside the IDE.

<IMG src="https://www.cogier.com/gambas/ExpandIt.png"> </IMG>

Here is the program: -
Attachment
Online now: No Back to the top

Post

Posted
Rating:
#7
Trainee
Thanks everyone! Up until now I had no idea about things like springs or using panels as spacers, or even the arrangement property. I guess Gambas just needs some better documentation to help make these things more discoverable and understandable but until then thanks again. :D
Online now: No Back to the top
1 guest and 0 members have just viewed this.