IonicWind Software

IWBasic => General Questions => Topic started by: paja on September 12, 2009, 04:52:10 AM

Title: Control item move ?
Post by: paja on September 12, 2009, 04:52:10 AM
Hi,

1) How can I move @STATIC and @RGNBUTTON control to any x/y position from the program - not with mouse.

2) Is possible to put into @STATIC control the image and text together ?
Title: Re: Control item move ?
Post by: LarryMc on September 12, 2009, 06:53:35 AM
Quote from: paja on September 12, 2009, 04:52:10 AM
1) How can I move @STATIC and @RGNBUTTON control to any x/y position from the program - not with mouse.

See SETSIZE command in help file.

SETSIZE mywindow, newx, newy, 100, 250,mycontrol

Larry
Title: Re: Control item move ?
Post by: LarryMc on September 12, 2009, 07:05:24 AM
Quote from: paja on September 12, 2009, 04:52:10 AM
2) Is possible to put into @STATIC control the image and text together ?
From the Windows programming/Controls/Control creation section of the help file.

QuoteBitmap buttons and static controls

Buttons and static controls have the capability of displaying a bitmap instead of text. To define a bitmap button use the flag @CTLBTNBITMAP for a button or @CTLSTCBITMAP for static controls To specify the bitmap to display set the buttons text to the complete pathname to the bitmap  file with the SETCONTROLTEXT statement.

So the answer is no.  But just about anything is possible if you subclass the control and draw it yourself.

Larry
Title: Re: Control item move ?
Post by: paja on September 12, 2009, 07:32:37 AM
Thanks

But please can you more specify: " ... if you subclass the control and draw it yourself"
Title: Re: Control item move ?
Post by: LarryMc on September 12, 2009, 07:56:48 AM
search the forum for "subclass"

If you are not familiar with the term then you likely won't be able to do it.

Larry
Title: Re: Control item move ?
Post by: LarryMc on September 12, 2009, 08:08:22 AM
This was written by Fletchie(rip) from the old forums:

QuoteEvery control has an entry point - where it receives it's messages, keydown/up, mouse moves etc,etc...

SubClassing allows us to intercept the messages - and discard and/or act on them. In a way we're creating a gateway to the control.

Any window/control can be subclassed - as long as it's owned by the process that wants to do the 'checking'. - unless you go through more hoops than a deranged something or the other.

SubClassing is one of those things where you can do something simple (like ignore certain keys) or take it to extremes and have controls within controls etc,etc...

It's a great answer for the times when you wish you could do such and such with a control.

Larry
Title: Re: Control item move ?
Post by: ZeroDog on September 13, 2009, 10:55:14 AM
instead of using a @STATIC control, you could simply PRINT the text to the window, on top of an image you have loaded into the window.
Title: Re: Control item move ?
Post by: paja on September 13, 2009, 11:44:14 AM
But I need to move with picture like an object on the screen.
Title: Re: Control item move ?
Post by: aurelCB on September 13, 2009, 01:00:59 PM
Just create static control with bitmap flag and put your bitmap to control with
Setcontroltext command.Nothing special.
So if you need move control use SETSIZE command.
And change first two values x,y coordinate of your control.
Title: Re: Control item move ?
Post by: paja on September 13, 2009, 03:43:09 PM
It is OK. But the main problem is to write text into STATIC too.
Title: Re: Control item move ?
Post by: Allan on September 13, 2009, 04:46:34 PM
Maybe you could create the image and text together in a Bitmap and just use that new image in the Static control.

http://www.ionicwind.com/forums/index.php/topic,3506.0.html

Picture Control may be of use?

Allan

Title: Re: Control item move ?
Post by: aurelCB on September 13, 2009, 05:38:04 PM
Ah I see you want bouth things in static control - i think that is not posibile ::)
Like man says use bitmap with text...
Or use two static controls, one with bitmap and one with text and move them together.