Page 2 of 2
Re: Using Filler and BitMap gadgets
Posted: Sat Dec 08, 2012 6:19 pm
by abalaban
@thomas
Thank you fo rthe sample. Unfortunately I won't be able to look at it this week-end. Probably not until Monday.
Out of curiosity is the clipping "problem" of the button gadget normal?
Re: Using Filler and BitMap gadgets
Posted: Sat Dec 08, 2012 7:05 pm
by thomasrapp
I am not sure what you expect and what you are doing. Normally if you attach an image to a gadget, the gadget is sized by the size of the image. No clipping is needed. Of course if you make the gadget smaller than the image (or the image bigger than the gadget), then the image renders outside of the gadget's area.
I have tried with a button gadget and if I attach an image via GA_Image to the button, the button refuses to shrink below the size of the image. So everything is fine.
If you change the size of a GUI object without notifying the GUI about the change (i.e. without calling WM_RETHINK), all strange things can happen. Normally the GUI sizes the objects and not the other way round.
Re: Using Filler and BitMap gadgets
Posted: Mon Dec 10, 2012 9:20 am
by abalaban
thomasrapp wrote:I have tried with a button gadget and if I attach an image via GA_Image to the button, the button refuses to shrink below the size of the image. So everything is fine.
Interesting, what was the system you were using? AmigaOS 4?
thomasrapp wrote:I am not sure what you expect and what you are doing. Normally if you attach an image to a gadget, the gadget is sized by the size of the image. No clipping is needed. Of course if you make the gadget smaller than the image (or the image bigger than the gadget), then the image renders outside of the gadget's area.
If you change the size of a GUI object without notifying the GUI about the change (i.e. without calling WM_RETHINK), all strange things can happen. Normally the GUI sizes the objects and not the other way round.
When I create my GUI there is no bitmap attached to the button. Then I create a bitmap whose size fits into the button, attach it to the button using RefreshSetGadgetAttrsA() everything is fine and displays correctly. Now using the weightbar of my Layout, or the size gadget of my window the button accepts to shrink beside the size of the bitmap.
Now you are right I'm not calling the method WM_RETHINK on my window, on the other hand the method's documentation is rather sparse and does not states in which conditions this method must be called. So that's probably the problem, in fact I thought this method had to be called when a direct child was modified not when an sub-object of a child (I thought it was dealt by the set method).
Thank you for your patience and your help, that's very much appreciated by the Reaction newbie I am.
Re: Using Filler and BitMap gadgets
Posted: Tue Dec 11, 2012 9:08 am
by abalaban
@thomas
Thank you that was the right solution. Now I can resize my preview without any problem. Thank you very much!