28 January 2021, 22:04 | #1 |
Registered User
Join Date: Jan 2021
Location: UK
Posts: 53
|
Blitz Basic 2.1 - Window command
Hi All,
Does anyone have a list of all the FLAGS for the WINDOW command anywhere they could share please? I'm using workbench 3, but not sure if that makes a difference. Also, does anyone know how to create a scroll gadget in the WINDOW command, or via another BB2 command? Thanks in advance. |
30 January 2021, 00:28 | #2 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
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 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. |
30 January 2021, 01:13 | #3 |
Gets there in the end...
Join Date: Sep 2005
Location: Wales
Posts: 862
|
I'm sure I remember one of the Blitz examples had a superbitmap window with a scroll gadget but I could be wrong.
|
30 January 2021, 18:55 | #4 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
Yeah, that seems vaguely familiar to me too, but I couldn't find it yesterday when I looked for it. It may be buried in an issue of BUM, or be on Aminet or something like that. Would be good to have!
|
18 February 2021, 11:21 | #5 | |
Registered User
Join Date: Jan 2021
Location: UK
Posts: 53
|
Quote:
Seems a real shame they couldn't make creating a scrollbar easier when there are so many other easy options for modifying a new Window, but there you have it! |
|
18 February 2021, 13:03 | #6 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
Yeah, a higher level library that contains an additional layer for dealing with things like this might be a good thing to have alright. I guess they just stuck relatively closely to the actual OS calls and procedures for the most straightforward implementation (from the library's side).
As an alternative, I wonder if using MUI would be helpful? That handles things like window size, and while I'm not sure if it supports actual window scrollbars, it does support group scrollbars for gadget groups larger than the visible area. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blitz basic] How much amiga-blitz friendly is this? | saimon69 | Coders. Blitz Basic | 105 | 21 April 2022 19:45 |
Blitz Basic (1) | Retro1234 | Coders. Blitz Basic | 9 | 18 February 2016 17:54 |
Blitz Basic CustomCop command | JPQ | Coders. General | 1 | 23 November 2014 22:23 |
Blitz 2 command information | Anakirob | request.Other | 4 | 31 May 2011 22:21 |
Blitz Basic 2 | LaundroMat | Retrogaming General Discussion | 5 | 24 July 2001 08:10 |
|
|