Qbound
31-12-2007 16:26:00
Hi,
atm i am creating the inventory visuals for our client. I decided to take a panel as the base for the listed items.
The items are made from an image on the left, and a console on the right as infofield.
3 things:
1. how can i reduce the space between the lines in the console. (i don't can set the mItemHeight directly from the console widget)
2. i have a problem if i disallow the scrolling with (allowScrolling( false)) i get an crash from the inside of quickgui...
3. if i have some more items for testing in the panel i got a clipping problem with the items. The images are clipped very well but the console didn't clip at the panel borders.
I think the difference is that the image is directly created from the panel and the consel too, but has created some own widget (possible not from the parent?)
here is the code
here is a screenshot
atm i am creating the inventory visuals for our client. I decided to take a panel as the base for the listed items.
The items are made from an image on the left, and a console on the right as infofield.
3 things:
1. how can i reduce the space between the lines in the console. (i don't can set the mItemHeight directly from the console widget)
2. i have a problem if i disallow the scrolling with (allowScrolling( false)) i get an crash from the inside of quickgui...
3. if i have some more items for testing in the panel i got a clipping problem with the items. The images are clipped very well but the console didn't clip at the panel borders.
I think the difference is that the image is directly created from the panel and the consel too, but has created some own widget (possible not from the parent?)
here is the code
// First create a unique name
string strName = "bt";
strName += pItem->cName;
strName += StringConverter::toString( m_ulUniqueID );
// Create the button on the left
QuickGUI::Image* pImage = m_pPANEL_Inventory->createImage( strName );
// Save the spacesettings between the images
UINT uiYSpace = m_rIM_ItemImage.y;
// calculate the position based on the size of the inventory vector
m_rIM_ItemImage.y = (m_rIM_ItemImage.height * m_vInventory.size()) + uiYSpace;
// set the dimension
pImage->setDimensions( m_rIM_ItemImage );
// set the image
strName = "0/";
strName += pItem->cName;
pImage->setMaterial( strName );
LogManager::getSingletonPtr()->logMessage( "--------------------> " + strName );
// Create the InfoBox on the right side of the image
// Create the unique name
strName = "co";
strName += pItem->cName;
strName += StringConverter::toString( m_ulUniqueID );
QuickGUI::Console* pCO = m_pPANEL_Inventory->createConsole( strName );
pCO->hideInputBox();
//pCO->allowScrolling( false );
//pCO->setHorizontalPixelPadWidth( 10 );
// Use the same position as the button
m_rCO_ItemInfo.y = m_rIM_ItemImage.y;
// Set the dimensions
pCO->setDimensions( m_rCO_ItemInfo );
// Write the information
strName = "Name: "; strName += pItem->cName; pCO->addText( strName );
strName = "Weight: "; strName += StringConverter::toString( pItem->sWEIGHT * 100 ) + " g"; pCO->addText( strName );
strName = "Price: "; strName += StringConverter::toString( pItem->uiPRICE_BUY ) + " Cr"; pCO->addText( strName );
here is a screenshot