How to make a thing like a table?

Artic_Ice83

06-12-2007 20:36:17

Hi! I'd like to make a thing like a table with two columns and multiples rows.
One column isn't editable, the other column instead is editable.
There is an object "pre-confectioned" like this?
I thought to made this with a pair of two textbox, one read only (setReadOnly(true)) and one not (setReadOnly(false)).

this is the simplified "layout":
Column1
----------------------------------------------
TextBox not Editable | TextBox Editable|
----------------------------------------------

How can implement this?

Qbound

06-12-2007 22:07:59

Hi,

if i am right then you want to create a gui like this

UserName: memyselfandi
Password: ########

Left read only right input?

Declar the variables

TextBox* m_pGUI_WINDOW_Logon_TB_UserPassword; // UserPassword
TextBox* m_pGUI_WINDOW_Logon_TB_UserPassword_DATA; // UserPassword


Set the Eventhandler Function

void EVT_GUI_Button_Login( const EventArgs& args ); // GUI Event Button Login


Create the gui


m_pGUI_WINDOW_Logon_TB_UserPassword = m_pGUI_WINDOW_Logon->createTextBox();
m_pGUI_WINDOW_Logon_TB_UserPassword->setDimensions( QuickGUI::Rect( 10, 135, 94, 15 ) );
m_pGUI_WINDOW_Logon_TB_UserPassword->setText( " " + m_pLanguageMGR->Get( wPASSWORD ) );
m_pGUI_WINDOW_Logon_TB_UserPassword->setReadOnly( true );
m_pGUI_WINDOW_Logon_TB_UserPassword_DATA= m_pGUI_WINDOW_Logon->createTextBox();
m_pGUI_WINDOW_Logon_TB_UserPassword_DATA->setDimensions( QuickGUI::Rect( 120, 135, 94, 15 ) );
m_pGUI_WINDOW_Logon_TB_UserPassword_DATA->maskUserInput( '-' );
m_pGUI_WINDOW_Logon_TB_UserPassword_DATA->addOnEnterPressedEventHandler( &CGS_KICKSTART::EVT_GUI_Button_Login, this );


react on the event handler

// ------------------------------------------------------------------------------------------------
// Name: EVT_GUI_Button_Login( const EventArgs& args )
// Info: Handle the Event that the User clicked on the Login Button
//
// Return = () Nothing
// Nothing
// ------------------------------------------------------------------------------------------------
void CGS_KICKSTART::EVT_GUI_Button_Login( const EventArgs& args )
{
// Nachricht nullen
ZeroMemory( m_pMessenger->GetUserInfo(), sizeof( CLIENT_S ) );

// User and Password
string strUser = m_pGUI_WINDOW_Logon_TB_UserName_DATA->getText();
string strPassword = m_pGUI_WINDOW_Logon_TB_UserPassword_DATA->getText();

// UserInfo f�llen
memcpy( m_pMessenger->GetUserInfo()->cUserName, strUser.c_str(), strUser.length() );
memcpy( m_pMessenger->GetUserInfo()->cPassword, strPassword.c_str(), strPassword.length() );

// Die Nachricht versenden
m_pMessenger->Send( ID_RQ_CLIENT_LOGIN, (PBYTE)m_pMessenger->GetUserInfo(), sizeof( CLIENT_S ) );
}
// ------------------------------------------------------------------------------------------------


the last part of the function is not necessary but can give you a hint how it is fully implemented.

kungfoomasta

06-12-2007 22:29:09

I haven't been able to make any multi column lists, but what you want to achieve is done as QBound says. A non-editable text box is pretty much a label, so I would just make a label next to a textbox. The QuickGUI Demo can be used as reference in addition to QBounds code.

Artic_Ice83

07-12-2007 11:23:44

Thanks to all!
@Qbound:
but the line code m_pGUI_WINDOW_Logon_TB_UserPassword_DATA->addOnEnterPressedEventHandler( &CGS_KICKSTART::EVT_GUI_Button_Login, this );
the function addOnEnterPressedEventHandler() is defined in QuickGUI or you defined it yourself?

@kungfoomasta: in fact a couple of label--TextBox is what i need...i didn't think in this way in the beginning... :oops:
But i have a question: i must create a window that contains all couples or i can put all on screen without assign them to a window?

kungfoomasta

07-12-2007 17:51:06

You can create them as children of the Sheet, which display directly on the Render Window. :)

Artic_Ice83

07-12-2007 20:36:14

yeah! i have just try the both things, on render window and on a window created and it goes!
looking at the code of the demo, i did a "rollover" effect for the text box...i love the immediacy of quick gui!!!! :D
I'd like to ask a question: can i set a background image for the render window from QuickGUI (for example using the image widget) or i have to set from the createScene method?

Artic_Ice83

07-12-2007 20:36:44

yeah! i have just try both things, on render window and on a window created and both goes!
looking at the code of the demo, i did a "rollover" effect for the text box...i love the immediacy of quick gui!!!! :D
I'd like to ask a question: can i set a background image for the render window from QuickGUI (for example using the image widget) or i have to set from the createScene method?

kungfoomasta

07-12-2007 21:05:41

If you have a totally 2d scene, then you can just set the sheet's texture and that will be the background. However if you have 3d objects in your scene, and want a background behind those, you would probably want to do that outside of QuickGUI. You have to render the background with a render queue earlier than the objects in the scene, in this case. You can actually specify the render queue for QuickGUi to use, but this would make all widgets appear behind the scene. You can't create widgets behind and in front of 3d objects.

One experiment would be to have 2 GUIManagers, one behind the scene and one in front. You would need to hide the mouse cursor created on the back GUIManager. I haven't tried this, but this would be intended behavior, given the system design..