Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Open Reality / How to set the style of spread to drop-down list
  RSS 2.0 ATOM  

How to set the style of spread to drop-down list
Rate this thread
 
35590
 
Permlink of this thread  
avatar
  • chindy
  • Posted: 14 October 2009 04:07 PM
  • Total Posts: 16
  • Joined: 21 February 2009 11:37 AM

Hi:

I create a spread cell, and try to set the style of the cell as a drop-down list. Ref the attachment, it’s a screenshot of MotionBuilder.

Here is my code.

// Setting the cell style as CellStyleView
m_Spread.GetColumn( ALSubItemIndex_list).Style kFBCellStyleView;
m_spread.GetColumn( ALSubItemIndex_list).Width 15;
...
// When adding an row
// Set the Cell as a layout, a list in this layout
FBLayout fbLayout;
fbLayout.AddRegion(
 
"List",
 
"List",
 
g_childWindowOffsetkFBAttachLeft""1.0,
 
g_childWindowOffsetkFBAttachTop,  ""1.0,
 
g_buttonWidth 2,  kFBAttachNone,  ""1.0,
 
g_buttonHeight,      kFBAttachNone""1.0
 )
FBList fbList
;
fbList.Style kFBDropDownList;
fbList.Items.InsertAt(0"option1")
fbList
.Items.InsertAt(1"option2")
fbLayout
.SetControl("List"fbList)
m_spread
.SetCellView(refALSubItemIndex_ProfilefbLayout.GetHIKtView("List"))

When I click the created cell, my tool crash.

So, is there someone know the right way to set the cell style as drop-down list, thank you so much!



Replies: 0
avatar
  • qhliao
  • Posted: 16 October 2009 01:55 AM

There are multiple style could be used for cells in spread.

//! Different styles of spreadsheet cell styles.
enum FBCellStyle  { 
 kFBCellStyleDefault
//!< Default cell style.
 
kFBCellStyleString//!< String.
 
kFBCellStyleDouble//!< Double.
 
kFBCellStyleInteger//!< Integer.
 
kFBCellStyleButton//!< Button.
 
kFBCellStyle2StatesButton//!< 2 state button.
 
kFBCellStyle3StatesButton//!< 3 state button.
 
kFBCellStyleMenu//!< Menu.
 
kFBCellStyleVoid//!< Void (no value).
 
kFBCellStyleView//!< View (user definable, you need to specify the view using FBSpread::SetCellView()).
    
kFBCellStyleTime            //!< Time.
};

You could use Menu Style instead of View Style.

mFBSpread.GetCell(lReflColumn).Style kFBCellStyleMenuStyle;

and then you can setup the menu entries by:

mFBSpread.SetCell(lReflColumn"Menu 1~Menu 1~Menu 3")

Hope this works for you case.




Replies: 0