View Single Post
Old 30 January 2021, 00:28   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 5,307
Good questions. I might suggest though that a better place for them might be the Blitz Basic subforum that you can find here. Maybe a mod can move this thread?

Now, the thing about the flags field is that it's not Blitz-specific, but the Blitz documentation doesn't really tell you that. It gives you a list of values you can use in the manual (which is available in AmigaGuide format on Aminet, and online here, with the specific page listing the flags here), which will work fine, but Amiga OS itself defines these values and provides names for them to make them easier to work with. Blitz supports these constants too, but the manual doesn't really explain how you can use them.

To use the OS constants (which includes constants introduced since Blitz was released), you need to refer to the Amiga Developer Docs, and in particular, the intuition header file which defines all the flags. Do a search for values beginning with WFLG_ and you'll see all the possible values, and the OpenWindow() documentation for detailed descriptions of each flag.

Using these flags in Blitz means adding a resident file to the compiler settings. These are more or less the same thing as header files in C like I linked to above, but they're precompiled. You can add them to your program by opening the compiler settings and adding blitzlibs:amigalibs.res to the residents list. Once that's done, the flags will be available for use. They're called the same as the OS documentation lists them, but in Blitz, they need a # symbol before the name to denote a constant. With this resident enabled, you can open a window like this:

Code:
Window 0, 100, 100, 200, 100, #WFLG_DRAGBAR|#WFLG_DEPTHGADGET|#WFLG_CLOSEGADGET|#WFLG_ACTIVATE, "Test Window", 1, 2
If the line ends up too long for the editor, you can add the values together, store in a variable, and use that variable in the Window command instead. Make sure the variable is a Long type.

Now, scrollbars for windows aren't a simple thing, and unlike many OS features, Blitz doesn't offer any convenient shortcuts. As a result, you need to do it manually, which needs several steps. There's a lot involved, and I'm not 100% up to snuff on it myself, but the basics are that you need to create scrollbars yourself using Intuition gadgets, then attach them to the window borders using special flag values. You also need to adjust the maximum and visible values of the scrollbar so it keeps in proportion with whatever you're showing.
Daedalus is offline  
 
Page generated in 0.04431 seconds with 11 queries