Who's Online
79 user(s) are online (
35 user(s) are browsing
Forums )
Members: 0
Guests: 79
more...
Topic options
View mode
Newest First
[Solved] MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/4 20:59
#1
Just can't stay away
Joined: 2012/8/14 13:51Last Login
: 1/16 17:31
From France
Group:
Registered Users
Hello,
I have again a question about BitMap, sorry...
I'm trying to show a Bitmap as full size in MUI and/or Intuition window.
If the Bitmap size is > window size, I don't know how to scroll to show the hidden parts of the bitmap.
In the following grab, I'm trying with MUI and with Intuition Window but I can't reproduce MultiView way to do.
http://zzd10h.amiga-ng.org/FastView/Bitmap_scroll.jpg My Bitmap seems OK because when I resize my MUI window, I show the hidden part.
For MUI window, I create it with tags
MUIA_Window_Width,width,
MUIA_Window_Height,height,
MUIA_Window_CloseGadget,FALSE,
MUIA_Window_UseRightBorderScroller,TRUE,
MUIA_Window_UseBottomBorderScroller,TRUE,
For Intuition window,
WA_SizeGadget, TRUE,
WA_DragBar, TRUE,
WA_DepthGadget, TRUE,
Is a simple way to do that ?
Thank by advance, for your kind help...
(sorry again to ask to much questions.)
Guillaume
Edited by zzd10h on 2013/5/7 21:05:25
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/5 6:41
#2
Just popping in
Joined: 2006/12/27 21:09Last Login
: 2/5 21:00
Group:
Registered Users
You need to work out the difference between window size and bitmap size, then update the sliders accordingly, and act on received messages from these offsetting your blitting with these values.
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/5 15:20
#3
Just can't stay away
Joined: 2012/8/14 13:51Last Login
: 1/16 17:31
From France
Group:
Registered Users
Thank you for your reply. I hoped that I will be easier :(
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/5 19:23
#4
Just popping in
Joined: 2007/3/23 8:11Last Login
: 3/4 7:06
From Rehmerloh, Germany
Group:
Registered Users
Quote:
I hoped that I will be easier :( It is easier, with MUI at least. Use something like this:
Child , ScrollgroupObject ,
MUIA_Scrollgroup_UseWinBorder , TRUE ,
MUIA_Scrollgroup_Contents , VGroupV ,
Child , < add your objects here ...>
End ,
End ,
This should work in principle. I did not test this code, but wrote it just from memory right now.
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/5 19:53
#5
Just can't stay away
Joined: 2006/11/30 11:30Last Login
: Today 20:32
From Finland
Group:
Registered Users
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/5 20:36
#6
Just can't stay away
Joined: 2012/8/14 13:51Last Login
: 1/16 17:31
From France
Group:
Registered Users
@tboeckel :
Thank you.
I tried it with this code
window_image = WindowObject ,
MUIA_Window_Title , titre ,
MUIA_Window_Width , width ,
MUIA_Window_Height , height ,
MUIA_Window_CloseGadget , FALSE ,
WindowContents , imageGroupe = VGroup ,
Child , ScrollgroupObject ,
MUIA_Scrollgroup_UseWinBorder , TRUE ,
MUIA_Scrollgroup_Contents , VGroupV ,
Child , Im_Data_full_bmp = BitmapObject ,
MUIA_Bitmap_Width , width ,
MUIA_Bitmap_Height , height ,
MUIA_Bitmap_Bitmap , bitmap , End ,
End ,
End ,
End ,
End ;
It shows the scrollbar but they are not effective...
http://zzd10h.amiga-ng.org/FastView/FastView_ScrollMUI.jpg @salass00
Thank for your sample, the hard way to do, I will try to understand it ;)
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/6 18:50
#7
Just popping in
Joined: 2007/3/23 8:11Last Login
: 3/4 7:06
From Rehmerloh, Germany
Group:
Registered Users
Quote:
It shows the scrollbar but they are not effective... Take the Virtual demo source as reference. The upper left virtual group does exactly what you want, except that it is showing a simple text instead of a bitmap.
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/6 21:52
#8
Just can't stay away
Joined: 2012/8/14 13:51Last Login
: 1/16 17:31
From France
Group:
Registered Users
Great, Thore it works now !
But only for DTpicObject, no for Bitmap.
left = BitmapObject
right = DTPicObject
http://zzd10h.amiga-ng.org/FastView/DTPic.jpg As I want to display pictures as full size, DTPic will be nice but I have to subclass it to use a handle dispatcher (for keyboard input).
With Bitmap it works (but scrollbars are not working) with
Child , Im_Data_full_bmp = NewObject ( mcc -> mcc_Class , NULL , BitmapObject ,
MUIA_Bitmap_Width , width ,
MUIA_Bitmap_Height , height ,
MUIA_Bitmap_Bitmap , bitmap , TAG_DONE ),
End ,
But it failed for DTPic (display an empty Picture, compilation OK) with
Child , Im_Data_full_bmp = NewObject ( mcc_dtpic -> mcc_Class , NULL ,
DtpicObject , MUIA_Dtpic_Name , image , TAG_DONE ), End ,
Code working for DTpic (without subclass) is
window_image = WindowObject ,
MUIA_Window_Title , titre ,
MUIA_Window_Width , width ,
MUIA_Window_Height , height ,
MUIA_Window_CloseGadget , FALSE ,
WindowContents ,
imageGroupe = ScrollgroupObject ,
MUIA_Scrollgroup_Contents , VGroupV , VirtualFrame ,
End ,
End ,
End ;
Thore,
do you know
1) why the scrollers failed to operate with my Bitmap (it fails with or without mcc_class) ?
2) if it possible to create a NewObject DtpicObject like that ?
Thank you by advance.
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/7 8:45
#9
Just popping in
Joined: 2007/3/23 8:11Last Login
: 3/4 7:06
From Rehmerloh, Germany
Group:
Registered Users
Quote:
Child , Im_Data_full_bmp = NewObject ( mcc -> mcc_Class , NULL , BitmapObject ,
MUIA_Bitmap_Width , width ,
MUIA_Bitmap_Height , height ,
MUIA_Bitmap_Bitmap , bitmap , TAG_DONE ),
End ,
This cannot really work, because you are passing the result of a MUI_NewObject() call (inserted by the BitmapObject macro) as single tag without data to your own NewObject() call.
If your "mcc" variable is a subclass of Bitmap.mui, then the correct call must look like this:
Child , Im_Data_full_bmp = NewObject ( mcc -> mcc_Class , NULL ,
MUIA_Bitmap_Width , width ,
...
TAG_DONE ),
The same applies to a subclass of Dtpic.mui. You can pass all attributes directly to the NewObject() call.
Please note that the OM_NEW method of your own class must pass all attributes it receives to the DoSuperMethod() call via TAG_MORE. For reference take a look at YAM's source of its
Shutdown window . It is a very simple class which consists of a constructor only. The inittags() macro looks like this:
#define inittags(msg) (((struct opSet *)msg)->ops_AttrList)
Quote:
1) why the scrollers failed to operate with my Bitmap (it fails with or without mcc_class) ?This most probably fails because of the wrong object creation.
Quote:
2) if it possible to create a NewObject DtpicObject like that ?No, see my explanation above.
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/7 12:27
#10
Just can't stay away
Joined: 2012/8/14 13:51Last Login
: 1/16 17:31
From France
Group:
Registered Users
Thank you Thore,
But even without use of subclassing, mcc, etc... ScrollBars appears but doesn't work with BitMapObject.
window_image = WindowObject ,
MUIA_Window_Title , titre ,
MUIA_Window_Width , width , MUIA_Window_Height , height ,
WindowContents ,
imageGroupe = ScrollgroupObject ,
MUIA_Scrollgroup_Contents , VGroupV , VirtualFrame ,
Child , Im_Data_full_bmp = BitmapObject ,
MUIA_Bitmap_Width , width ,
MUIA_Bitmap_Height , height ,
MUIA_Bitmap_Bitmap , bitmap ,
End ,
End ,
End ,
End ;
I will try this evening to correct NewObject calls
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/7 15:13
#11
Just popping in
Joined: 2007/3/23 8:11Last Login
: 3/4 7:06
From Rehmerloh, Germany
Group:
Registered Users
Quote:
ScrollBars appears but doesn't work with BitMapObject. Enforce a fixed sized bitmap object using MUIA_FixWidth,TRUE and MUIA_FixHeight,TRUE.
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/7 18:54
#12
Just can't stay away
Joined: 2012/8/14 13:51Last Login
: 1/16 17:31
From France
Group:
Registered Users
No luck for me, it's worst :)
With FixWidth and FixHeight it shows a very little windows with a little thing in center
The same result with or without mcc->mcc_class.
If I remove, BitmapObject at
NewObject(mcc->mcc_Class,NULL,BitmapObject,...) compilation failed.
ImageGroupe = ScrollgroupObject ,
MUIA_Scrollgroup_Contents , VGroupV , VirtualFrame ,
Child , Im_Data_full_bmp = BitmapObject ,
MUIA_Bitmap_Width , width ,
MUIA_Bitmap_Height , height ,
MUIA_Bitmap_Bitmap , bitmap ,
MUIA_FixWidth , TRUE , MUIA_FixHeight , TRUE ,
End ,
I will try to make a short complete sample...
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/7 19:53
#13
Just can't stay away
Joined: 2012/8/14 13:51Last Login
: 1/16 17:31
From France
Group:
Registered Users
Ah, it works now.
It's was just
MUIA_FixWidth,width, MUIA_FixHeight,height,
and not with dimensions and not TRUE...
screenshot ;)
http://zzd10h.amiga-ng.org/FastView/FastView_Scroll_Bitmap_OK.jpg Therefore, now scrollbars work with BitmapObject even with subclassing, wonderful !!!
Thank a lot Thore for all your help.
Guillaume
here is the code who works :
WindowContents ,
imageGroupe = ScrollgroupObject ,
MUIA_Scrollgroup_Contents , VGroupV , VirtualFrame ,
Child , Im_Data_full_bmp = NewObject ( mcc -> mcc_Class , NULL , BitmapObject ,
MUIA_Bitmap_Width , width ,
MUIA_Bitmap_Height , height ,
MUIA_Bitmap_UseFriend , TRUE , MUIA_Background , NULL ,
MUIA_FixWidth , width , MUIA_FixHeight , height ,
MUIA_Bitmap_Bitmap , bitmap ,
TAG_DONE ), End ,
End ,
End ,
End ;
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Posted on:
2013/5/7 20:09
#14
Just popping in
Joined: 2007/3/23 8:11Last Login
: 3/4 7:06
From Rehmerloh, Germany
Group:
Registered Users
Quote:
MUIA_FixWidth,width, MUIA_FixHeight,height, Sorry, I wrote the stuff from memory and mixed up boolean values with real dimensions.
Quote:
My name is written with a simple "o", no french dressing on top of it ;)
Quote:
Therefore, now scrollbars work with BitmapObject even with subclassing, wonderful !!! Now place the scrollbars in the window border, at least IIRC this was one of the wishes in the beginning. Add MUIA_Scrollgroup_UseWinBorder,TRUE to your Scrollgroup object and MUIA_Window_UseRightBorderScroller,TRUE and MUIA_Window_UseBottomBorderScroller,TRUE to your window object.
Currently Active Users Viewing This Thread:
1
(
0 members
and 1 Anonymous Users
)