11 December 2013, 08:30 | #1 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
|
Prop-Gadgets in Window Border HowTo?
Hi,
I would like to put scrollers into my window borders. I followed the docs but my gadgets do not appear. The window border looks the same as without the gadgets. What's missing? I have three empty buffers, one for the gadget structure, one for the propinfo structure and one for the knob image: Code:
.scrollers ; prepare scroller gadgets lea oxWin_gadget(a3),a0 move.w #GTYP_PROPGADGET|GTYP_GZZGADGET,gg_GadgetType(a0) move.w #GACT_BOTTOMBORDER,gg_Activation(a0) lea oxWin_propinfo(a3),a1 move.l a1,gg_SpecialInfo(a0) move.w #AUTOKNOB|FREEHORIZ|PROPNEWLOOK,pi_Flags(a1) move.w #MAXBODY,pi_HorizBody(a1) move.w #MAXBODY,pi_VertBody(a1) lea oxWin_image(a3),a1 move.l a1,gg_GadgetRender(a0) |
11 December 2013, 11:55 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,002
|
The GACT_BOTTOMBORDER flag only causes the size of the bottom border to be adjusted to the size and position of your gadget. But size and postition of the gadget have to be set appropiately, too. For this purpose GFLG_RELBOTTOM and GFLG_RELWIDTH are useful.
|
11 December 2013, 13:11 | #3 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
|
Thank you, but I am still lost. See Attachment how it looks. This is the current code. I am not able to get a spacing between the top of the bottom border and the top of the gadget. I made the gadget bigger so that you can better distinguish it from the window.. When I set GRELWIDTH, the right border of the gadget aligns with the right window border. then also no spacing there.
And another question: how do I get changes on the gadget when it is moved? I tried GACT_FOLLOWMOUSE, but what Message do I receive and how to get the GadgetID from it? Code:
.scrollers ; prepare scroller gadgets lea oxWin_gadget(a3),a0 move.w #50,gg_Height(a0) move.w #100,gg_Width(a0) move.w #-60,gg_TopEdge(a0) move.w #5,gg_LeftEdge(a0) move.w #GTYP_PROPGADGET|GTYP_GZZGADGET,gg_GadgetType(a0) move.w #GACT_BOTTOMBORDER,gg_Activation(a0) move.w #GRELBOTTOM,gg_Flags(a0) lea oxWin_propinfo(a3),a1 move.l a1,gg_SpecialInfo(a0) move.w #AUTOKNOB|FREEHORIZ|PROPNEWLOOK|PROPBORDERLESS,pi_Flags(a1) move.w #MAXBODY,pi_HorizBody(a1) move.w #MAXBODY,pi_VertBody(a1) lea oxWin_image(a3),a1 move.l a1,gg_GadgetRender(a0) Last edited by AGS; 11 December 2013 at 14:38. |
11 December 2013, 15:39 | #4 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,002
|
That's how it works. Usually you have the size gadget in the bottom right corner which keeps the border at a certain size. If you make your scroll bar smaller than that, you get some space above it.
In your case you probably have to add another (invisible) gadget which causes the border to stay at the desired size. Or just don't use GACT_BOTTOMBORDER. As you draw your own size gadget, you'll probably want to put the scroll bar next to it and not below it. |
11 December 2013, 17:11 | #5 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
|
The custom sizing gadget is only used when there are no scrollers. And with your kind help I now managed it to get it work as desired. Please could you or someone else also tell me how to get messages when the knobs are moved? and which messages?
|
11 December 2013, 19:15 | #6 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,002
|
If you set GACT_IMMEDIATE, you'll get an IDCMP_GADGETDOWN message when the user clicks on the gadget.
If you set GACT_RELVERIFY, you'll get an IDCMP_GADGETUP message when the user releases the mouse button. If you set GFLG_FOLLOWMOUSE, you'll get IDCMP_MOUSEMOVE messages while the user drags the bar. If the user clicks into the empty space beside the bar (in order to move the slider by a whole page at once), you'll get GADGETDOWN/UP messages, but no MOUSEMOVE IIRC. |
11 December 2013, 19:20 | #7 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
|
Ok, I understand so far. I assume that ALL mousemoves belong to the gadget while it is dragged? And the pointer to the Gadget then is in im_IAddress? Then check the ID there? I tried this, but did not find the Gadget ID there ... maybe I did something wrong?
EDIT: I solved it by storing which gadget ID at the GADGETDOWN. Until GADGETUP I take all mousemoves as move the knob of the selected gadget. It's funny that i get MOUSEMOVES even w/o having GFLG_FOLLOWMOUSE set. Do you know why? Last edited by AGS; 12 December 2013 at 00:50. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Alien Breed 3D Blaster plastic prop gun | Cherno | Nostalgia & memories | 0 | 11 October 2013 01:53 |
Small issue with string gadgets in settings window | mark_k | support.WinUAE | 0 | 07 March 2012 19:05 |
Activating WinUAE window coming from the left or the right border | thomas | support.WinUAE | 5 | 14 August 2010 18:06 |
How to change window border sizes/aspect ratio in ClassicWB Full? | mingle | project.ClassicWB | 4 | 28 June 2010 14:10 |
Soft which hide whole border of AmigaDos Window | olesio | support.Apps | 5 | 17 February 2009 01:21 |
|
|