Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
36 user(s) are online (31 user(s) are browsing Forums)

Members: 0
Guests: 36

more...

Support us!

Headlines

 
  Register To Post  

[Solved] MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
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
Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just popping in
Just popping in


See User information
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.

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
Thank you for your reply.
I hoped that I will be easier :(

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just popping in
Just popping in


See User information
Quote:
I hoped that I will be easier :(


It is easier, with MUI at least. Use something like this:

ChildScrollgroupObject
    
MUIA_Scrollgroup_UseWinBorderTRUE,
    
MUIA_Scrollgroup_ContentsVGroupV,
        
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.

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
@tboeckel :
Thank you.
I tried it with this code

window_image WindowObject,            
            
MUIA_Window_Titletitre,  
            
MUIA_Window_Width,width,
                    
MUIA_Window_Height,height
                    
MUIA_Window_CloseGadget,FALSE,                          
            
WindowContentsimageGroupe VGroup
                
ChildScrollgroupObject,  
                    
MUIA_Scrollgroup_UseWinBorderTRUE
                    
MUIA_Scrollgroup_Contents,VGroupV,     
                         
ChildIm_Data_full_bmp BitmapObject ,
                         
MUIA_Bitmap_Widthwidth,
                         
MUIA_Bitmap_Heightheight
                         
MUIA_Bitmap_BitmapbitmapEnd,                                           
                    
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 ;)

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just popping in
Just popping in


See User information
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.

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
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

ChildIm_Data_full_bmp NewObject(mcc->mcc_Class,NULL,BitmapObject
                    
MUIA_Bitmap_Widthwidth,
                    
MUIA_Bitmap_Heightheight
                    
MUIA_Bitmap_Bitmapbitmap,TAG_DONE), 
End,


But it failed for DTPic (display an empty Picture, compilation OK) with

ChildIm_Data_full_bmp NewObject(mcc_dtpic->mcc_Class,NULL,
                    
DtpicObjectMUIA_Dtpic_Nameimage,TAG_DONE), End,


Code working for DTpic (without subclass) is
window_image WindowObject,            
        
MUIA_Window_Titletitre,  
        
MUIA_Window_Widthwidth ,
            
MUIA_Window_Height,height  
            
MUIA_Window_CloseGadget,FALSE,                                   
            
WindowContents
                
imageGroupe ScrollgroupObject
                    
MUIA_Scrollgroup_ContentsVGroupVVirtualFrame,                                                                        
                
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.

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just popping in
Just popping in


See User information
Quote:
ChildIm_Data_full_bmp NewObject(mcc->mcc_Class,NULL,BitmapObject
                    
MUIA_Bitmap_Widthwidth,
                    
MUIA_Bitmap_Heightheight
                    
MUIA_Bitmap_Bitmapbitmap,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:

ChildIm_Data_full_bmp NewObject(mcc->mcc_ClassNULL,
  
MUIA_Bitmap_Widthwidth,
  ...
  
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.

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
Thank you Thore,
But even without use of subclassing, mcc, etc... ScrollBars appears but doesn't work with BitMapObject.

window_image WindowObject,             
        
MUIA_Window_Titletitre,   
        
MUIA_Window_Widthwidth ,       MUIA_Window_Height,height  ,                                                                 
            
WindowContents,  
                
imageGroupe ScrollgroupObject,  
                    
MUIA_Scrollgroup_ContentsVGroupVVirtualFrame,  
                                                                       
                         
ChildIm_Data_full_bmp BitmapObject 
                                 
MUIA_Bitmap_Widthwidth
                                 
MUIA_Bitmap_Heightheight,  
                                 
MUIA_Bitmap_Bitmapbitmap
             
End

                
End
            
End,     
        
End;


I will try this evening to correct NewObject calls

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just popping in
Just popping in


See User information
Quote:
ScrollBars appears but doesn't work with BitMapObject.


Enforce a fixed sized bitmap object using MUIA_FixWidth,TRUE and MUIA_FixHeight,TRUE.

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
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_ContentsVGroupVVirtualFrame,                            
ChildIm_Data_full_bmp BitmapObject
    
MUIA_Bitmap_Widthwidth,
    
MUIA_Bitmap_Heightheight,     
        
MUIA_Bitmap_Bitmapbitmap
    
MUIA_FixWidth,TRUEMUIA_FixHeight,TRUE,
        
End,


I will try to make a short complete sample...

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
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_ContentsVGroupVVirtualFrame,                
                        
ChildIm_Data_full_bmp NewObject(mcc->mcc_Class,NULL,BitmapObject,                                     
                                            
MUIA_Bitmap_Widthwidth,
                                            
MUIA_Bitmap_Heightheight,
                                            
MUIA_Bitmap_UseFriendTRUEMUIA_Background,NULL,    
                                            
MUIA_FixWidth,widthMUIA_FixHeight,height,                                                                                                                                                                                                                                                                     
                                            
MUIA_Bitmap_Bitmapbitmap,                                            
                                            
TAG_DONE), End
                                             
                    
End,
            
End,    
        
End;

Go to top
Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just popping in
Just popping in


See User information
Quote:
MUIA_FixWidth,width, MUIA_FixHeight,height,


Sorry, I wrote the stuff from memory and mixed up boolean values with real dimensions.

Quote:
screenshot ;)


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.


Go to top
[SOLVED] Re: MUI or Intuition : How to scroll a BitMap in a Window ?
Just can't stay away
Just can't stay away


See User information
Yes, better !

Screenshot updated without name error ;)

http://zzd10h.amiga-ng.org/FastView/FastView_Scroll_Bitmap_OK.jpg

Great, solved.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project