How best to move a control
Posted
#1
(In Topic #209)
Regular

I've tried a few things but the result is rather jerky.
Any suggestions welcome.
Posted
Regular

Code (gambas)
- .X = 100
- .Y = 100
- .W = 30
- .H = 30
- .Background = Color.Orange
- With Label1
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

Posted
Expert

Now that vuott has provided a good solution…..
Just out of curiosity, why do you want to move a label ?
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Regular

I've made a simple family tree project. Sometimes there are more siblings (name etc shown in a label) than will fit across the screen so by moving the labels left or right enables all of the siblings to be viewed.
Posted
Expert

You could put the view object where you create your family tree in a scroll view control and in that way you could just have a 'static' tree drawn and the user could just scroll the contents.
Would be interested in seeing the code when you finished as I would be interested in seeing how you handled the data relationship management.
Also I discovered that there is a 'move' procedure in some controls now.
I don't remember it being there but was not specifically looking for it either.
It allows a move with an optional resize which is cool.
From the Gambas wiki:…
Control.Move (gb.qt4)
Sub Move ( X As Integer, Y As Integer [ , Width As Integer, Height As Integer ] )
Moves and/or resizes the control.
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Regular

My mistake, In fact it was a project where I use mplayer to manage audio. I have a progress bar to show current position in the item and I wanted to be able to move a marker to a stop point underneath the progress bar.
With the family tree project I just change the X value of the labels (together with their vertical & horizontal connecting lines). Your suggestion of a scroll bar could be of interest. The database is a copy of the standard GEDCOM mysql db used in my web based family tree (a free genealogy manager called webtrees). I'd be happy to provide more details if you wish.
I'd be happy to copy you with the project when it's a bit more stable.
Regards
Bill
Posted
Expert

Put me on the list for code sharing once you're done. - Thanks
I collect code snippets and once I have enough of a similar type , I create a "tool-box class" for them.
Cheers - Quin.
I code therefore I am
I code therefore I am
1 guest and 0 members have just viewed this.


