Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
44 user(s) are online (38 user(s) are browsing Forums)

Members: 0
Guests: 44

more...

Support us!

Headlines

 
  Register To Post  

[SOLVED] Fuelgauge height
Supreme Council
Supreme Council


See User information
Looking at this image:

Resized Image

The fuelgauge at the bottom right annoyingly forces itself to a certain minimum height that is higher than the string field to the left of it. Does anyone have an idea on how to force it to follow the same height?


Edited by orgin on 2009/5/16 22:35:16
Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@orgin

Put it in a HGroup with the string gadget, and set CHILD_WeightedHeight,0.

Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@orgin

String.gadgets are not proportional vertically so when put next to other gadgets, they may have different height. Doing what Chris said will force all gadgets in the group to have the same minimum height (and lose proportionality).

Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@Chris

Didn't help, tried a gazillion different combinations back and forth and whetever I did they refused to get the same height.

I reverted the code back to what I started with below:

LAYOUT_AddChildHGroupObject,
     
LAYOUT_FixedVertFALSE,
     
LAYOUT_AddChildHGroupObject,
      
LAYOUT_AddChildinst->Gad[GID_StatusBar] = StringObject,
       
GA_IDGID_StatusBar,
       
GA_RelVerifyTRUE,
       
GA_GadgetHelpFALSE,
       
GA_ReadOnlyTRUE,
       
STRINGA_TextVal"",
       
STRINGA_MaxChars256,
      
End,
     
LayoutEnd,
     
LAYOUT_AddChildHGroupObject,
      
LAYOUT_FixedHorizFALSE,
      
CHILD_WeightedHeight0,
      
LAYOUT_AddChildFuelGaugeObject,
       
//GA_ID, GID_,
       
GA_Text"DH2: 3%",
       
FUELGAUGE_JustificationFGJ_CENTER,
       
FUELGAUGE_Min0,
       
FUELGAUGE_Max99,
       
FUELGAUGE_PercentFALSE,
       
FUELGAUGE_Ticks0,
       
FUELGAUGE_Level25
      
FuelGaugeEnd,
     
LayoutEnd,
    
LayoutEnd,


Any idea how to change it?

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@orgin

I vaguely recollect from memory that you must put CHILD_WeightedHeight, 0 after your HGroupObject definition, not inside - that is, after the HGroupObject's LayoutEnd. Have yout tried that?

Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@trixie

Made no difference.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@orgin

That's quite strange! I've just compiled a test GUI under OS3.9, and it does work as I described earlier: the string gadget and the gauge are placed in one horizontal group and both are made unproportional vertically through a common CHILD_WeightedHeight, 0. The code snippet:

...
LAYOUT_AddChild, HGroupObject,
LAYOUT_AddChild, StringObject,
GA_ID, GID_STRING,
GA_RelVerify, TRUE,
End, /* string */
LAYOUT_AddChild, FuelGaugeObject,
GA_ID, GID_GAUGE,
GA_RelVerify, TRUE,
End, /* fuelgauge */
End, /* HGroup */
CHILD_WeightedHeight, 0,
...

Go to top
Re: Fuelgauge height
Home away from home
Home away from home


See User information
@trixie

Does that code snippet make the guage smaller or the string gad taller?

The biggest difference between your code and orgins I can see is that you have a sing hgroup whereas orgin has each gadget inside an hgroup within the outer one. That could be undoing the effects of the WeightedHeight...

Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@orgin

Try something like this:


LAYOUT_AddChildHGroupObject,
     
LAYOUT_FixedVertFALSE,
     
LAYOUT_AddChildHGroupObject,
      
LAYOUT_AddChildinst->Gad[GID_StatusBar] = StringObject,
       
GA_IDGID_StatusBar,
       
GA_RelVerifyTRUE,
       
GA_GadgetHelpFALSE,
       
GA_ReadOnlyTRUE,
       
STRINGA_TextVal"",
       
STRINGA_MaxChars256,
      
StringEnd,
      
LAYOUT_AddChildFuelGaugeObject,
       
//GA_ID, GID_,
       
GA_Text"DH2: 3%",
       
FUELGAUGE_JustificationFGJ_CENTER,
       
FUELGAUGE_Min0,
       
FUELGAUGE_Max99,
       
FUELGAUGE_PercentFALSE,
       
FUELGAUGE_Ticks0,
       
FUELGAUGE_Level25
      
FuelGaugeEnd,
      
CHILD_WeightedWidth20,
     
LayoutEnd,
     
CHILD_WeightedHeight0,
    
LayoutEnd,

Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@trixie

Looks like this:

Resized Image

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@Rigo

Looks the same as the post above this one.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@broadblues

> Does that code snippet make the guage smaller
> or the string gad taller?

AFAIK string gadgets are never proportional vertically, their actual height depends on font size and is fixed (at least that was the case under OS3.x). So it is the gauge that is made the same height as the string in my example.

Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@orgin

You're right. I've removed the gauge ticks, added a button to the HGroupObject, and it now looks like below.

The button and the gauge are forced to the same minimum height while the string gadget is a little smaller than the two. This is under OS3.9. Sorry I'm lost here, can't help.

Resized Image

Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@orgin

It might look the same, but it isn't. The subtle difference is that the string and the fuelguage are in the same hgroup, and the WeightedHeight tag is applied to the layout, not each object.

The WeightedWidth tag is so that the fuelguage does not occupy 50% of the layout width, only 20%.

Simon

Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@Rigo

Just to indulge you I uploaded a snapshot of your 'solution'.

Resized Image

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@orgin

Try adding CHILD_WeightMinimum, TRUE to the HGroupObject that contains the two gadgets.

Simon

Go to top
Re: Fuelgauge height
Just popping in
Just popping in


See User information
@orgin

IIRC I was having the same problem when programming ARexx GUI with AWNPipe. I solved the design problem by suppressing the readonly string gadget, kept only the fuelgauge and put the text inside it. Saved a few bytes in the end.

Edit:typos

Bye,
TMTisFree

"Never ascribe to malice that which is adequately explained by incompetence." (Napol?on Bonaparte)
"I would love to change the world, but they won?t give me the source code." (Unknown)
Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@Rigo

No that didn't help. But the following placement of CHILD_MinHeight did, at least in my OS3.x test GUI:

...
LAYOUT_AddChild, HGroupObject,
LAYOUT_AddChild, StringObject,
GA_ID, GID_STRING,
GA_RelVerify, TRUE,
End, /* string */
LAYOUT_AddChild, FuelGaugeObject,
GA_ID, GID_GAUGE,
GA_RelVerify, TRUE,
FUELGAUGE_Ticks, FALSE,
End, /* fuelgauge */
CHILD_MinHeight, TRUE,
End, /* HGroup */
CHILD_WeightedHeight, 0,
...

Thanks for the tip, Rigo!

Go to top
Re: Fuelgauge height
Supreme Council
Supreme Council


See User information
@trixie&Rigo

OKey thanks, got it to work now.

Resized Image

LAYOUT_AddChildHGroupObject,
     
LAYOUT_FixedVertFALSE,
    
LAYOUT_AddChildHGroupObject,
     
LAYOUT_AddChildHGroupObject,
      
LAYOUT_AddChildinst->Gad[GID_StatusBar] = StringObject,
       
GA_IDGID_StatusBar,
       
GA_RelVerifyTRUE,
       
GA_GadgetHelpFALSE,
       
GA_ReadOnlyTRUE,
       
STRINGA_TextVal"",
       
STRINGA_MaxChars256,
      
End,
     
LayoutEnd,
     
LAYOUT_AddChildHGroupObject,
      
LAYOUT_FixedHorizFALSE,
      
LAYOUT_AddChildFuelGaugeObject,
       
//GA_ID, GID_,
       
GA_Text"DH2: 3%",
       
FUELGAUGE_JustificationFGJ_CENTER,
       
FUELGAUGE_Min0,
       
FUELGAUGE_Max99,
       
FUELGAUGE_PercentFALSE,
       
FUELGAUGE_Ticks0,
       
FUELGAUGE_Level3
      
FuelGaugeEnd,
      
CHILD_MinHeightTRUE,
     
LayoutEnd,
    
LayoutEnd,
    
CHILD_WeightedHeight0,
    
LayoutEnd,

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Fuelgauge height
Amigans Defender
Amigans Defender


See User information
@orgin

Great to hear it works! Here's a pint of Guinness to another Filer betaversion!

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