May 08, 2024, 06:01:37 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Control item move ?

Started by paja, September 12, 2009, 04:52:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paja

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 ?

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

paja

Thanks

But please can you more specify: " ... if you subclass the control and draw it yourself"

LarryMc

search the forum for "subclass"

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

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

ZeroDog

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.

paja

But I need to move with picture like an object on the screen.

aurelCB

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.

paja

It is OK. But the main problem is to write text into STATIC too.

Allan

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


aurelCB

September 13, 2009, 05:38:04 PM #11 Last Edit: September 13, 2009, 05:50:02 PM by aurelCB
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.