Add (and modify)a LAYOUT_AddImage object

3 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Add (and modify)a LAYOUT_AddImage object

Hi, me again. I have a layout with a button(image) and if user enables MAX_WINSIZE tooltype I want ot add/show just below such image another one, but using LAYOUT_AddImage, instead of an image inside a button.

  1. ...
  2. LAYOUT_AddChild, OBJ(OBJ_PREVIEWS) = IIntuition->NewObject(LayoutClass, NULL, //"layout.gadget",
  3. LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
  4. LAYOUT_HorizAlignment, LALIGN_CENTER,
  5. //LAYOUT_SpaceOuter, TRUE,
  6. LAYOUT_SpaceInner, FALSE,
  7. LAYOUT_AddChild, OBJ(OBJ_PREVIEW_BTN) = IIntuition->NewObject(ButtonClass, NULL, //"button.gadget",
  8. GA_ID, OBJ_PREVIEW_BTN,
  9. GA_RelVerify, TRUE,
  10. GA_Underscore, 0,
  11. BUTTON_BevelStyle, BVS_NONE,
  12. BUTTON_Transparent, TRUE,
  13. //BUTTON_BackgroundPen, BLOCKPEN,
  14. //BUTTON_FillPen, BLOCKPEN,
  15. TAG_DONE),
  16. CHILD_MaxWidth, 256, // pixels width of preview
  17. CHILD_MaxHeight, 224, // pixels height of preview
  18. TAG_DONE),
  19. ..
  20. if(MaxWinSize)
  21. { // Add preview box-cover image to General page/tab
  22. OBJ(OBJ_BOXCOVER_IMG) = IIntuition->NewObject(BitMapClass, NULL, //"bitmap.image",
  23. BITMAP_SourceFile, ROMS"/Covers3D/availablecover3d.png",
  24. BITMAP_Screen,screen, BITMAP_Masking,TRUE,
  25. TAG_DONE);
  26. if( OBJ(OBJ_BOXCOVER_IMG) )
  27. IIntuition->IDoMethod(OBJ(OBJ_PREVIEWS), LM_ADDIMAGE, pwindow, OBJ(OBJ_BOXCOVER_IMG), NULL);
  28. }
  29.  
  30. if( (pwindow=(struct Window *)IIntuition->IDoMethod(OBJ(OBJ_MAIN), WM_OPEN, NULL)) )
  31. {
  32. ...

it shows ok the image, but when I choose an entry from a listbrowser I want that such image (like the one from the button) changes too:

  1. ...
  2. IIntuition->IDoMethod( OBJ(OBJ_PREVIEWS), LM_REMOVECHILD, pw, OBJ(OBJ_BOXCOVER_IMG) );
  3. OBJ(OBJ_BOXCOVER_IMG) = IIntuition->NewObject(BitMapClass, NULL, //"bitmap.image",
  4. BITMAP_SourceFile, covers3d,
  5. BITMAP_Screen,screen, BITMAP_Masking,TRUE,
  6. TAG_DONE);
  7. if( OBJ(OBJ_BOXCOVER_IMG) ) {
  8. IIntuition->IDoMethod(OBJ(OBJ_PREVIEWS), LM_ADDIMAGE, pwindow, OBJ(OBJ_BOXCOVER_IMG), NULL);
  9. ...

But I'm missing what function do I need to call for refreshing and thus shows the new image until now haven't find the proper one. As I can see the new image if a resize the window or change from page/tab.
BTW could I use LM_MODIFYCHILD instead of LM_ADDIMAGE? How?

I tried with RefreshGList(), RefreshPageGadget() and RefreshGadgets(), but no luck, maybe I'm passing some wrong values?
TIA

mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
Re: Add (and modify)a LAYOUT_AddImage object

IIntuition->IDoMethod((Object *)Objects[OID_WINDOW],WM_RETHINK);
After add/remove. With your window object name.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: Add (and modify)a LAYOUT_AddImage object

Ok, thanks will try that ASAP.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments