05 August 2023, 13:16 | #1 |
Registered User
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
|
How to size windowing element internal spaces?
It's hard to describe what I'm asking in a title, so I'll elaborate.
When creating a window/screen, the size you give it is used by Intuition to draw a window/screen. The problem for my use case is that that width/height includes the window borders/gadgets or screen title bar. How do I make a screen or window while providing the size of the internal space (screen - titlebar, window - borders), rather than the size of the element as a whole. |
05 August 2023, 13:41 | #2 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
You normally need to find these values somewhere and add them yourself.
You will find them in the Screen structure (WBorLeft & similar values). To get to this structure you'll probably have to LockPubScreen(NULL). You may have to take screen's font size into account for title bars. Alternatively, you can use OpenWindowTagList and provide InnerWidth/InnerHeight tags instead of Width/Height. |
05 August 2023, 16:46 | #3 | ||
Registered User
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
|
Quote:
Quote:
LockPubScreen()is only usable in V36 and above right? Is there a way I can do this procedure below V36? |
||
05 August 2023, 17:00 | #4 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
Yes. If you need to run under pre-V36, your situation has become a little bit more complicated...
Quote:
GetScreenData()instead. |
|
05 August 2023, 17:11 | #5 |
Registered User
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
|
|
05 August 2023, 17:23 | #6 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
Good luck if you want to make menus. Without gadtools they're a real horror to do.
|
05 August 2023, 18:23 | #7 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,247
|
Quote:
Read intuition/intuition.h: Code:
#define WA_InnerWidth (WA_Dummy + 0x13) #define WA_InnerHeight (WA_Dummy + 0x14) /* You can specify the dimensions of the interior * region of your window, independent of what * the border widths will be. You probably want * to also specify WA_AutoAdjust to allow * Intuition to move your window or even * shrink it so that it is completely on screen. */ |
|
06 August 2023, 02:17 | #8 |
Registered User
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
|
|
06 August 2023, 08:09 | #9 |
Hardware Designer
Join Date: Aug 2018
Location: Bialystok/Poland
Age: 50
Posts: 179
|
|
07 August 2023, 11:07 | #10 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
Quote:
First, this needs V36+. The OP wants it to work under older versions. Second, it only affects window opening. There is no way to do the same for specifying window size when clicking the zoom gadget, nor there is a way to do it for minimum/maximum window size values. Third, you still need the border sizes as coordinates inside your window aren't exactly inside your window. You may wish to use GZZ for this, but it can fail in a number of ways. |
|
07 August 2023, 13:04 | #11 | ||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,247
|
Quote:
Code:
/* Bar sizes for this Screen and all Window's in this Screen */ /* Note that BarHeight is one less than the actual menu bar * height. We're going to keep this in V36 for compatibility, * although V36 artwork might use that extra pixel * * Also, the title bar height of a window is calculated from the * screen's WBorTop field, plus the font height, plus one. */ BYTE BarHeight, BarVBorder, BarHBorder, MenuVBorder, MenuHBorder; BYTE WBorTop, WBorLeft, WBorRight, WBorBottom; Quote:
|
||
07 August 2023, 13:34 | #12 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
Hence my first reply, which suggested the same thing as you did. Perhaps you should read whole threads before posting.
Quote:
Quote:
Quote:
When you want to reduce a window to its title bar thru the use of zoom gadget. Delitracker for example does this. Very useful to "minimize" a window, however GZZ prevents it (zoom gadget not changing the size anymore). Not to mention it is noted at several places it is more complicated than it should and not good for performance. |
|||
09 August 2023, 15:08 | #13 |
Registered User
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
|
As a side note, incase anyone's wondering I'm developing an interface library meant to port simple functionallity between operating systems. Things like memory management, windowing interface, user input devices (Mouse, Keyboard) etc.
You can write the same C code and just compile it for a different platform and it will work. Anyway, I'm going to the effort of porting it to the Amiga anyway, I figured why not support <V36, there's not much less it can do for a library. |
09 August 2023, 15:49 | #14 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
|
Quote:
I already have text console, memory management, automatic error handling, resource tracking, file i/o, 2d graphics (including screen conversions), keyboard, mouse, joystick, audio, timers (interrupts), clipboard, dynamic strings/arrays, and a few misc utilities. Having this kind of tools helps a lot when coding. Now adding user interface (windows, menus, gadgets, this kind of things). If it is that you want, perhaps we could somehow join efforts ? Quote:
All my game ports use it, for example. Quote:
How can the very same interface work on displays as different as baseline miggy with its 640x256 4-color, compared to peecees or whatever with (now as bare minimum) 1920x1080 true color ? It will either be ugly on one side (or both), even in comparison to native ones, or not work at all on the smallest. |
|||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Remove element from stack? | Steam Ranger | Coders. Asm / Hardware | 7 | 17 November 2022 00:21 |
AMIGA 4000D internal ide cf card size limit? | oguzog | support.Hardware | 18 | 09 September 2021 20:29 |
[C] CYCLE_KIND gadget shows only first element, then nothing. | mateusz_s | Coders. System | 5 | 29 March 2021 09:49 |
Internal window size changes on theme change | mark_k | support.WinUAE | 2 | 23 December 2012 21:43 |
AmigaDOS directories with spaces in? | boomtopper | support.Apps | 14 | 11 May 2007 12:57 |
|
|