10 June 2014, 02:55 | #1 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
Get Gadget Width
Not even sure if this is possible. OS3.9 and ReAction gadgets.
- I have a horizontal group split into 2 sections by LAYOUT_WeightBar. - The left side has a minumum off 100 and max of 300 pixels. - The right can be what ever size according to the window size. - The left side is a just a full size (no padding) listbrowser. I would like to be able get the size of the left area when the user resizes the weight bar so I can save it so when next time the program is started, set that side to actual pixel (not weighted percent) size. So, GetAttrs() to get the listbrowser's width, save it in prefs, quit, re-open with same pixel width. Either set the width in the layout code (preferred), or do a SetGadgetAttrs() to the width after the window is opened. |
10 June 2014, 13:02 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
Interesting challenge. Find my first try attached.
|
11 June 2014, 02:27 | #3 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
Cool. Got it working. Not pixel perfect because of rounding. And, I also forgot to say that I also save the window width/height, which will also vary.
Code:
ULONG GetNavigationWidth() { ULONG sum=MainWindow->Width-(!IsOS4 ? 22 : 28)-6+14; ULONG sum2=sum/2; ULONG w1=NavigationGad->Width; w1 = (w1 * 100 + sum2) / sum; return w1; } Then in the layout code for the navigation gadget Code:
CHILD_WeightedWidth, Prefs->NavigationWidth, Code:
CHILD_WeightedWidth, 99-Prefs->NavigationWidth, |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Where can I get the Progress.gadget from? | Tony Landais | request.Apps | 6 | 16 December 2015 19:16 |
Width adjustment stopped working on 1084S-P2. | e5frog | support.Hardware | 3 | 17 April 2014 23:16 |
How to add an Iconify-Gadget to a Window? | AGS | Coders. System | 5 | 15 January 2014 15:41 |
Decent fixed width fonts. | killergorilla | request.Other | 29 | 02 February 2007 19:16 |
Gadget/Layout.gadget V44 | ruliovega | support.Apps | 6 | 02 January 2006 11:50 |
|
|