Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11855 Posts in 1569 Topics- by 3024 Members - Latest Member: floutleMili

07. February 2012, 03:32:02 AM
Xith3D CommunityGeneral CategoryFeature Requests & Brilliant Ideas (Moderators: Marvin Fröhlich, 'n ddrylliog)Hudrequest
Pages: [1]
Print
Author Topic: Hudrequest  (Read 2255 times)
Mancer
Enjoying the stay
*
Offline Offline

Posts: 68


View Profile
« on: 09. June 2008, 08:24:28 PM »

Hi,

My project have an heavy usage of the Xith HUD, and it leads to questions/ requests :

  • Can we have methods to enable/disable widgets (and contextMenu) which automatically grays and set unclickable ?

In order to have this
Code:
button.setEnabled(true);

instead of  this
Code:
private void setEnabled(Button button, boolean enabled) {
if (enabled) {
button.setFontColor(Colorf.WHITE);
button.setClickable(true);
} else {
button.setFontColor(Colorf.GRAY);
button.setClickable(false);
}
}


  • Why in the Frame class the headerHeight is fixed to 20f instead of the Theme value ?
Code:
    /**
     * {@inheritDoc}
     */
    @Override
    protected WindowHeaderWidget createHeaderWidget( WindowHeaderWidget.Description headerDesc, String title )
    {
        final float headerHeight = 20f;
       
        return( new WindowHeaderWidget( getWidth(), headerHeight, headerDesc, title ) );
    }

instead of
Code:
    /**
     * {@inheritDoc}
     */
    @Override
    protected WindowHeaderWidget createHeaderWidget( WindowHeaderWidget.Description headerDesc, String title )
    {
        final float headerHeight = headerDesc.getHeight();
       
        return( new WindowHeaderWidget( getWidth(), headerHeight, headerDesc, title ) );
    }


  • It should be fine if, when it is popped up, the HUDConsole gain focus. Actually we have on click on it before writing commands...

  • Why the Console commands are located in Jagatoo ?

  • Is it possible to add a description method in Console commands?

Code:
    /**
     * @return the description of this command
     */
    public String getDescription();

This is for having an "Help" command used to list all available commands and describe what each command used for.


  • Sometime, in my code, I have to execute action on Msgbox close.

So, for my usage, I have slightly modified the Xith original file but I think it could be useful for other users too.

Also I was wondering if a kind of InputBox is planned in the future.
If not, as I need it, I have to create it...  Grin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #1 on: 09. June 2008, 10:15:29 PM »

Can we have methods to enable/disable widgets (and contextMenu) which automatically grays and set unclickable ?
...

Yes. Definitely a good idea. I will implement this soon (next week or so).

Why in the Frame class the headerHeight is fixed to 20f instead of the Theme value ?

Well, the value from the theme is measured in pixels. And we need a value in HUD-coodinates. This value would have to be converted, which is not possible at this time, since the window has to be added to the HUD before this can be done. I guess, I did this as a don't-know-how-to-do-this--will-fix-this-later thing Smiley.

It should be fine if, when it is popped up, the HUDConsole gain focus. Actually we have on click on it before writing commands...

Fixed.

Why the Console commands are located in Jagatoo ?

There are no Console commands in JAGaToo. There are just Commands, that can be (and are) used in the Console Wink.

Is it possible to add a description method in Console commands?

I have added getText() and getLocalizedText() methods. I used these names to be compatible to the LabeledInputAction interface, which already has these methods and a class must be able to implement both interfaces and should not be forced to implement two methods, that actually do the same.

I advice you to use the getLocalizedText() instead of getText(). It actually returns the result of getText() atm. But I will implement a localization system for these classes in the near future.

Sometime, in my code, I have to execute action on Msgbox close.

So, for my usage, I have slightly modified the Xith original file but I think it could be useful for other users too.

There is already a DialogListener, that alos works for the MsgBox (which is a Dialog). You can use setCloseCommand( ... ) and addDialogListener( ... ). No need for an additional callback system.

And I guess, you just forgot to remove your set-to-black code. It won't definitely be in the MsgBox.DefaultFactory. If you want a black background, set it through the Theme or implement your own, separate MsgBox.Factory class.

Also I was wondering if a kind of InputBox is planned in the future.
If not, as I need it, I have to create it...  Grin

I will definitely implement one in the near future (next week or so).

Please update from SVN to get the above fixes.

Marvin
Logged
Mancer
Enjoying the stay
*
Offline Offline

Posts: 68


View Profile
« Reply #2 on: 10. June 2008, 10:35:30 AM »

Again, thanks a lot for all your job on this project...
 Wink
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #3 on: 14. June 2008, 11:36:40 PM »

I have added an InputBox. I have also taken your idea of a listener for the MsgBox constructor. You can now pass a DialogListener to the MsgBox.show() methods (optional). Even if the InputBox works with a DialogListener, there is an additional InputBoxListener, that you can use as an alternative. This time it definitely makes sense, since the InputBox doesn't simply return some kind of command, but also the entered text. The InputBoxListener takes care of these additional information, for which you would have to use an odd case using the DialogListener-way. Oh, btw. The MsgBox and InputBox are now in the package org.xith3d.ui.hud.dialogs.

And I have added a setEnabled()/isEnabled() method pair to some widgets like Label, Button, RadioButton, CheckBox, etc. You can control the additional font/color settings through the theme of through setters on the widget itself of on its description object.

Have fun Smiley.

Marvin
Logged
Mancer
Enjoying the stay
*
Offline Offline

Posts: 68


View Profile
« Reply #4 on: 16. June 2008, 07:07:25 PM »

Thanks a lot, it works very fine...

Xith rules  Wink


PS:
Can i prepare one another request list ?  Grin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #5 on: 16. June 2008, 07:43:16 PM »

Can i prepare one another request list ?  Grin

Sure. Go ahead.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic