Rollup, spinners & edti boxes

Rollup, spinners & edti boxes

Anonymous
Not applicable
320 Views
2 Replies
Message 1 of 3

Rollup, spinners & edti boxes

Anonymous
Not applicable
Hello everybody, I've made a 3DS Studio scene exporter using Max SDK and I'd like to add a GUI in order to let the users adjust some export settings... well, right now I have a simple dialog with only two buttons "Export" and "Cancel", here is the code:

...

INT_PTR CALLBACK DlgProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);

bool CExporter::ShowOptions( HINSTANCE aHInstance, HWND aHwnd )
{
INT_PTR lResult = DialogBoxParam( aHInstance, MAKEINTRESOURCE(IDD_EXPORTERDLG), aHwnd, DlgProc, (LPARAM)this );

KRM_ASSERT( lResult >= 0 );

return true;
}

INT_PTR CALLBACK CExporter::DlgProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
static CExporter* lExporter; //class with Exporter implementation

switch(message)
{
case WM_INITDIALOG:
lExporter = (CExporter*)lParam;
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_BUTTON_EXPORT: EndDialog(hWnd,0); break;
case IDC_BUTTON_CANCEL: EndDialog(hWnd,0); break;
}
break;
case WM_CLOSE:
EndDialog(hWnd,0);
return TRUE;
}

return FALSE;
}

...



I'd like to add a rollup with some spinners linked to their edit boxes in it (just to show numeric values), I've tried It but It doesn't seem to work I can't get the values... can anybody tell me how to do that or show me a simple example?


Thanks a lot!
0 Likes
321 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
I think you need to add a ParamBlockDesc2 to your code:


static ParamBlockDesc2 simpleobjecttest_param_blk ( simpleobjecttest_params, _T("params"),  0, &simpleObjectTestDesc, 
P_AUTO_CONSTRUCT + P_AUTO_UI, PBLOCK_REF,
//rollout
IDD_PANEL, IDS_PARAMS, 0, 0, NULL,
// params
pb_spin, _T("spin"), TYPE_FLOAT, P_ANIMATABLE, IDS_SPIN,
p_default, 0.1f,
p_range, 0.0f,1000.0f,
p_ui, TYPE_SPINNER, EDITTYPE_FLOAT, IDC_EDIT, IDC_SPIN, 0.01f,
end,
end
);
0 Likes
Message 3 of 3

Anonymous
Not applicable
Ok! thanks Mike, now It works but without using Param blocks. I misunderstood some concepts, I was trying to add the spinner & Edit Box directly on the rollup instead of creating a Dialog and add it to the main dialog later...

Thanks anyway!
0 Likes