本文整理汇总了C++中ISpinnerControl::LinkToEdit方法的典型用法代码示例。如果您正苦于以下问题:C++ ISpinnerControl::LinkToEdit方法的具体用法?C++ ISpinnerControl::LinkToEdit怎么用?C++ ISpinnerControl::LinkToEdit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISpinnerControl
的用法示例。
在下文中一共展示了ISpinnerControl::LinkToEdit方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupWindow
void RandKeysUtil::SetupWindow(HWND hWnd)
{
this->hWnd = hWnd;
CheckDlgButton(hWnd,IDC_RANDKEYS_TIME,doTime);
CheckDlgButton(hWnd,IDC_RANDKEYS_VAL,doVal);
iPosTime = GetISpinner(GetDlgItem(hWnd,IDC_RANDKEYS_POSTIMESPIN));
iPosTime->SetLimits(0, TIME_PosInfinity, FALSE);
iPosTime->SetScale(10.0f);
iPosTime->LinkToEdit(GetDlgItem(hWnd,IDC_RANDKEYS_POSTIME), EDITTYPE_TIME);
iPosTime->SetValue(posTime,FALSE);
iNegTime = GetISpinner(GetDlgItem(hWnd,IDC_RANDKEYS_NEGTIMESPIN));
iNegTime->SetLimits(0, TIME_PosInfinity, FALSE);
iNegTime->SetScale(10.0f);
iNegTime->LinkToEdit(GetDlgItem(hWnd,IDC_RANDKEYS_NEGTIME), EDITTYPE_TIME);
iNegTime->SetValue(negTime,FALSE);
iPosVal = GetISpinner(GetDlgItem(hWnd,IDC_RANDKEYS_POSVALSPIN));
iPosVal->SetLimits(0.0f, 999999999.9f, FALSE);
iPosVal->SetScale(0.1f);
iPosVal->LinkToEdit(GetDlgItem(hWnd,IDC_RANDKEYS_POSVAL), EDITTYPE_FLOAT);
iPosVal->SetValue(posVal,FALSE);
iNegVal = GetISpinner(GetDlgItem(hWnd,IDC_RANDKEYS_NEGVALSPIN));
iNegVal->SetLimits(0.0f, 999999999.0f, FALSE);
iNegVal->SetScale(0.1f);
iNegVal->LinkToEdit(GetDlgItem(hWnd,IDC_RANDKEYS_NEGVAL), EDITTYPE_FLOAT);
iNegVal->SetValue(negVal,FALSE);
SetStates();
}
示例2: ExportDlgProc
// Dialog proc
static INT_PTR CALLBACK ExportDlgProc(HWND hWnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
Interval animRange;
ISpinnerControl *spin;
AscOut *exp = (AscOut*)GetWindowLongPtr(hWnd,GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
exp = (AscOut*)lParam;
SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam);
CenterWindow(hWnd, GetParent(hWnd));
// Setup the spinner controls for the floating point precision
spin = GetISpinner(GetDlgItem(hWnd, IDC_PREC_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd,IDC_PREC), EDITTYPE_INT );
spin->SetLimits(1, 10, TRUE);
spin->SetScale(1.0f);
spin->SetValue(exp->GetPrecision() ,FALSE);
ReleaseISpinner(spin);
// Setup the spinner control for the static frame#
// We take the frame 0 as the default value
animRange = exp->GetInterface()->GetAnimRange();
spin = GetISpinner(GetDlgItem(hWnd, IDC_STATIC_FRAME_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd,IDC_STATIC_FRAME), EDITTYPE_INT );
spin->SetLimits(animRange.Start() / GetTicksPerFrame(), animRange.End() / GetTicksPerFrame(), TRUE);
spin->SetScale(1.0f);
spin->SetValue(0, FALSE);
ReleaseISpinner(spin);
break;
case CC_SPINNER_CHANGE:
spin = (ISpinnerControl*)lParam;
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
spin = GetISpinner(GetDlgItem(hWnd, IDC_PREC_SPIN));
exp->SetPrecision(spin->GetIVal());
ReleaseISpinner(spin);
spin = GetISpinner(GetDlgItem(hWnd, IDC_STATIC_FRAME_SPIN));
exp->SetStaticFrame(spin->GetIVal() * GetTicksPerFrame());
ReleaseISpinner(spin);
EndDialog(hWnd, 1);
break;
case IDCANCEL:
EndDialog(hWnd, 0);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
示例3: Initialize
void RendSplineParamsMapDlgProc::Initialize(HWND hWnd, TimeValue t)
{
if (hWnd == NULL) return;
else
{
ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
iSpin->LinkToEdit(GetDlgItem(hWnd, IDC_ASPECT), EDITTYPE_FLOAT);
iSpin->SetLimits(0.0f,99999999.0f);
iSpin->SetAutoScale(TRUE);
ReleaseISpinner(iSpin);
if (RendSpline::hLockButton == NULL) {
HBITMAP hBitmap, hMask;
RendSpline::hLockButton = ImageList_Create(16, 15, TRUE, 2, 0);
hBitmap = LoadBitmap(RendSplineDesc.HInstance(), MAKEINTRESOURCE(IDB_LOCK));
hMask = LoadBitmap(RendSplineDesc.HInstance(), MAKEINTRESOURCE(IDB_LOCKMASK));
ImageList_Add(RendSpline::hLockButton,hBitmap,hMask);
DeleteObject(hBitmap);
DeleteObject(hMask);
}
ICustButton *lockAspect = GetICustButton(GetDlgItem(hWnd,IDC_ASPECTLOCK));
lockAspect->SetImage(RendSpline::hLockButton,0,0,1,1,16,15);
lockAspect->SetType(CBT_CHECK);
ReleaseICustButton(lockAspect);
CheckRadioButton(hWnd, IDC_VIEWPORT, IDC_RENDERER, IDC_RENDERER);
BOOL usePhysUVs = mod->GetUsePhysicalScaleUVs();
CheckDlgButton(hWnd, IDC_REAL_WORLD_MAP_SIZE, usePhysUVs);
}
}
示例4: TrackPropDlgProc
INT_PTR CALLBACK TrackPropDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
BlockControl *blk = (BlockControl*)GetWindowLongPtr(hWnd,GWLP_USERDATA);
ISpinnerControl *spin;
static TSTR zero = FormatUniverseValue(0.0f);
Rect rect;
switch (msg) {
case WM_INITDIALOG:
{
blk = (BlockControl*)lParam;
SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam);
Interval range = GetCOREInterface()->GetAnimRange();
spin = GetISpinner(GetDlgItem(hWnd,IDC_STARTSPIN));
spin->SetLimits(-999999.0f,9999999.0f, FALSE);
spin->SetAutoScale();
spin->LinkToEdit(GetDlgItem(hWnd,IDC_START), EDITTYPE_INT);
spin->SetValue(range.Start()/GetTicksPerFrame(),FALSE);
ReleaseISpinner(spin);
blk->propStart = range.Start()/GetTicksPerFrame();
CenterWindow(hWnd,GetParent(hWnd));
break;
}
case CC_SPINNER_CHANGE:
spin = (ISpinnerControl*)lParam;
switch (LOWORD(wParam)) {
case IDC_STARTSPIN: blk->propStart = spin->GetIVal(); break;
}
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
{
EndDialog(hWnd,1);
blk->NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE);
break;
}
case IDCANCEL:
EndDialog(hWnd,0);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
示例5: UpdateRollup
void MouseDeviceBinding::UpdateRollup(IRollupWindow *iRoll)
{
if (iRoll->GetNumPanels()>1) {
HWND hWnd = iRoll->GetPanelDlg(1);
CheckDlgButton(hWnd,IDC_MOUSE_X,which==MC_MOUSE_X);
CheckDlgButton(hWnd,IDC_MOUSE_Y,which==MC_MOUSE_Y);
CheckDlgButton(hWnd,IDC_MOUSE_FLIP,invert);
ISpinnerControl *spin = GetISpinner(GetDlgItem(hWnd,IDC_MOUSE_SCALESPIN));
spin->SetLimits(0.0f, float(999999), FALSE);
spin->SetScale(0.01f);
spin->LinkToEdit(GetDlgItem(hWnd,IDC_MOUSE_SCALE), EDITTYPE_FLOAT);
spin->SetValue(scale,FALSE);
ReleaseISpinner(spin);
}
}
示例6: if
//.........这里部分代码省略.........
setup_layout(ro, &pos, current_y);
Value* fw = control_param(fieldwidth);
int spin_width = (fw == &unsupplied) ? ro->current_width / 2 : fw->to_int() + 10;
GetTextExtentPoint32(ro->rollout_dc, text, static_cast<int>(_tcslen(text)), &size);
int lbl_width = size.cx;
int orig_width = lbl_width + spin_width;
pos.width = orig_width + 2;
pos.left = pos.left + ro->current_width - pos.width;
pos.height = ro->text_height + 3;
process_layout_params(ro, &pos, current_y);
// place spinner elements
int cex = (fw == &unsupplied) ? pos.width * lbl_width / orig_width : pos.width - spin_width;
cex = min(cex, pos.width);
width = lbl_width; height = ro->text_height;
left = pos.left + cex - width - 1; top = pos.top;
label = CreateWindow(_T("STATIC"),
text,
WS_VISIBLE | WS_CHILD | WS_GROUP,
left, top, width, height,
parent, (HMENU)label_id, hInstance, NULL);
width = pos.width - cex - 13; height = ro->text_height + 3;
left = pos.left + cex + 1;
edit_box = CreateWindowEx(0,
CUSTEDITWINDOWCLASS,
_T(""),
WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_GROUP,
left, top, width, height,
parent, (HMENU)edit_box_id, hInstance, NULL);
left += width; width = 10;
spinner = CreateWindowEx(0,
SPINNERWINDOWCLASS,
_T(""),
WS_VISIBLE | WS_CHILD,
left, top, width, height,
parent, (HMENU)control_ID, hInstance, NULL);
SendDlgItemMessage(parent, label_id, WM_SETFONT, (WPARAM)ro->font, 0L);
SendDlgItemMessage(parent, edit_box_id, WM_SETFONT, (WPARAM)ro->font, 0L);
/* setup the spinner control */
ISpinnerControl* spin = GetISpinner(spinner);
Value* range = control_param(range);
Value* type = control_param(type);
Value* scaleval = control_param(scale);
if (type == n_integer)
spin_type = EDITTYPE_INT;
else if (type == n_worldUnits)
spin_type = EDITTYPE_UNIVERSE;
else if (type == n_float || type == &unsupplied)
spin_type = EDITTYPE_FLOAT;
else
throw TypeError (MaxSDK::GetResourceStringAsMSTR(IDS_SPINNER_TYPE_MUST_BE_INTEGER_OR_FLOAT), type);
if (ro->init_values)
{
if (range == &unsupplied)
{
min = 0.0f; max = 100.0f; value = 0.0f;
}
else if (is_point3(range))
{
Point3 p = range->to_point3();
min = p.x; max = p.y; value = p.z;
}
else
throw TypeError (MaxSDK::GetResourceStringAsMSTR(IDS_SPINNER_RANGE_MUST_BE_A_VECTOR), range);
if (scaleval == &unsupplied)
{
scale = (spin_type == EDITTYPE_INT) ? 1.0f : 0.1f;
}
else
scale = scaleval->to_float();
}
spin->LinkToEdit(edit_box, spin_type);
spin->SetScale(scale);
if (spin_type == EDITTYPE_INT)
{
spin->SetLimits((int)min, (int)max, FALSE);
spin->SetValue((int)value, FALSE);
}
else if (spin_type == EDITTYPE_UNIVERSE)
{
spin->SetLimits(min, max, FALSE);
spin->SetValue(value, FALSE);
}
else
{
spin->SetLimits(min, max, FALSE);
spin->SetValue(value, FALSE);
}
ReleaseISpinner(spin);
}
示例7: if
//----------------------------------------------------------------------------
BOOL PX2SceneExport::OnInitDialog (HWND hWnd)
{
// 当对话框获得WM_INITDIALOG消息时,进行初始化。
// 设置用户定义的导出选项。如果配置文件存在,这些导出选项和用户最后一次
// 使用导出插件的选项一样。否则,使用缺省的设置。
CheckDlgButton(hWnd,IDC_CHECK_OBJECTS,mSettings.IncludeObjects);
CheckDlgButton(hWnd,IDC_CHECK_LIGHTS,mSettings.IncludeLights);
CheckDlgButton(hWnd,IDC_CHECK_MESHES,mSettings.IncludeMeshes);
CheckDlgButton(hWnd,IDC_CHECK_VERTEXCOLORS,mSettings.IncludeVertexColors);
CheckDlgButton(hWnd,IDC_CHECK_NORMALS,mSettings.IncludeNormals);
CheckDlgButton(hWnd, IDC_CHECK_TANGENTBINORMAL,
mSettings.IncludeTargentBiNormal);
CheckDlgButton(hWnd,IDC_CHECK_TEXTURECOORDS,mSettings.IncludeTexCoords);
SendMessage(GetDlgItem(hWnd,IDC_COMMBO_NUMTCS),CB_ADDSTRING,0,(LPARAM)"1");
SendMessage(GetDlgItem(hWnd,IDC_COMMBO_NUMTCS),CB_ADDSTRING,0,(LPARAM)"2");
SendMessage(GetDlgItem(hWnd,IDC_COMMBO_NUMTCS), CB_SETCURSEL,
mSettings.NumTexCoords-1,0);
CheckDlgButton(hWnd,IDC_CHECK_MODIFIERS,mSettings.IncludeModifiers);
CheckDlgButton(hWnd,IDC_CHECK_SKINS,mSettings.IncludeSkins);
CheckDlgButton(hWnd,IDC_RADIO_CURRENTFRAME,mSettings.IncludeCurrentFrame);
CheckDlgButton(hWnd,IDC_RADIO_KEYFRAMES,mSettings.IncludeKeyFrames);
CheckDlgButton(hWnd,IDC_RADIO_ALLFRAMES,mSettings.IncludeAllFrames);
CheckDlgButton(hWnd,IDC_CHECK_USELOCALTIME,mSettings.UseLocalTime);
if(!mSettings.IncludeObjects)
{
// 取消激活“Objects”选择框
OnObjectsChecked(hWnd, FALSE);
}
else if (!mSettings.IncludeMeshes)
{
// 取消激活“Mesh”选择框
OnMeshChecked(hWnd, FALSE);
}
// 取消激活"Modifiers"选择框
if (!mSettings.IncludeModifiers)
OnModifiersChecked(hWnd, FALSE);
// 获得max场景中的帧数
int numFrames = mMax->GetAnimRange().Duration()/GetTicksPerFrame();
// spinner controls
ISpinnerControl* spinner = GetISpinner(GetDlgItem(hWnd,
IDC_SPINNER_STARTFRAME));
spinner->LinkToEdit(GetDlgItem(hWnd,IDC_EDIT_STARTFRAME), EDITTYPE_INT);
spinner->SetLimits(0,numFrames,TRUE);
spinner->SetScale(1.0f);
spinner->SetValue(0,FALSE);
if ( mSettings.IncludeCurrentFrame )
{
spinner->Enable(FALSE);
}
ReleaseISpinner(spinner);
spinner = GetISpinner(GetDlgItem(hWnd,IDC_SPINNER_ENDFRAME));
spinner->LinkToEdit(GetDlgItem(hWnd,IDC_EDIT_ENDFRAME),EDITTYPE_INT);
spinner->SetLimits(0,numFrames,TRUE);
spinner->SetScale(1.0f);
spinner->SetValue(numFrames,FALSE);
if (mSettings.IncludeCurrentFrame)
{
spinner->Enable(FALSE);
}
ReleaseISpinner(spinner);
SetDlgItemText(hWnd, IDC_EDIT_SRCROOTDIR, mSettings.SrcRootDir);
SetDlgItemText(hWnd, IDC_EDIT_DSTROOTDIR, mSettings.DstRootDir);
return TRUE;
}
示例8: IGameExporterOptionsDlgProc
/**
* Configuration interface
**/
INT_PTR CALLBACK IGameExporterOptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
ParamList* exp = DLGetWindowLongPtr<ParamList*>(hWnd);
ISpinnerControl* spin;
switch (message)
{
case WM_INITDIALOG:
{
exp = (ParamList*)lParam;
DLSetWindowLongPtr(hWnd, lParam);
CenterWindow(hWnd, GetParent(hWnd));
//fill Ogre version combo box
#ifdef UNICODE
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_SETMINVISIBLE, 30, 0);
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)L"Ogre Latest");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)L"Ogre 1.8");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)L"Ogre 1.7");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)L"Ogre 1.4");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)L"Ogre 1.0");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_SETCURSEL, (int)exp->meshVersion, 0);
//fill material prefix
std::wstring resPrefix_w;
resPrefix_w.assign(exp->resPrefix.begin(), exp->resPrefix.end());
SendDlgItemMessage(hWnd, IDC_RESPREFIX, WM_SETTEXT, 0, (LPARAM)resPrefix_w.data());
//fill material sub dir
std::wstring materialOutputDir_w;
materialOutputDir_w.assign(exp->materialOutputDir.begin(), exp->materialOutputDir.end());
SendDlgItemMessage(hWnd, IDC_MATDIR, WM_SETTEXT, 0, (LPARAM)materialOutputDir_w.data());
//fill texture sub dir
std::wstring texOutputDir_w;
texOutputDir_w.assign(exp->texOutputDir.begin(), exp->texOutputDir.end());
SendDlgItemMessage(hWnd, IDC_TEXDIR, WM_SETTEXT, 0, (LPARAM)texOutputDir_w.data());
//fill mesh subdir
std::wstring meshOutputDir_w;
meshOutputDir_w.assign(exp->meshOutputDir.begin(), exp->meshOutputDir.end());
SendDlgItemMessage(hWnd, IDC_MESHDIR, WM_SETTEXT, 0, (LPARAM)meshOutputDir_w.data());
//fill prog subdir
std::wstring programOutputDir_w;
programOutputDir_w.assign(exp->programOutputDir.begin(), exp->programOutputDir.end());
SendDlgItemMessage(hWnd, IDC_PROGDIR, WM_SETTEXT, 0, (LPARAM)programOutputDir_w.data());
#else
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_SETMINVISIBLE, 30, 0);
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)"Ogre Latest");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)"Ogre 1.8");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)"Ogre 1.7");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)"Ogre 1.4");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_ADDSTRING, 0, (LPARAM)"Ogre 1.0");
SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_SETCURSEL, (int)exp->meshVersion, 0);
//fill material prefix
SendDlgItemMessage(hWnd, IDC_RESPREFIX, WM_SETTEXT, 0, (LPARAM)(char*)exp->resPrefix.c_str());
//fill material sub dir
SendDlgItemMessage(hWnd, IDC_MATDIR, WM_SETTEXT, 0, (LPARAM)(char*)exp->materialOutputDir.c_str());
//fill texture sub dir
SendDlgItemMessage(hWnd, IDC_TEXDIR, WM_SETTEXT, 0, (LPARAM)(char*)exp->texOutputDir.c_str());
//fill mesh subdir
SendDlgItemMessage(hWnd, IDC_MESHDIR, WM_SETTEXT, 0, (LPARAM)(char*)exp->meshOutputDir.c_str());
//fill prog subdir
SendDlgItemMessage(hWnd, IDC_PROGDIR, WM_SETTEXT, 0, (LPARAM)(char*)exp->programOutputDir.c_str());
#endif
spin = GetISpinner(GetDlgItem(hWnd, IDC_RESAMPLE_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd, IDC_RESAMPLE_STEP), EDITTYPE_INT);
spin->SetLimits(1, 100, TRUE);
spin->SetScale(1.0f);
spin->SetValue(exp->resampleStep, FALSE);
ReleaseISpinner(spin);
//advanced config
CheckDlgButton(hWnd, IDC_YUPAXIS, exp->yUpAxis);
CheckDlgButton(hWnd, IDC_SHAREDGEOM, exp->useSharedGeom);
CheckDlgButton(hWnd, IDC_GENLOD, exp->generateLOD);
CheckDlgButton(hWnd, IDC_EDGELIST, exp->buildEdges);
CheckDlgButton(hWnd, IDC_TANGENT, exp->buildTangents);
CheckDlgButton(hWnd, IDC_SPLITMIRROR, exp->tangentsSplitMirrored);
CheckDlgButton(hWnd, IDC_SPLITROT, exp->tangentsSplitRotated);
CheckDlgButton(hWnd, IDC_STOREPARITY, exp->tangentsUseParity);
CheckDlgButton(hWnd, IDC_CONVDDS, exp->convertToDDS);
CheckDlgButton(hWnd, IDC_RESAMPLE_ANIMS, exp->resampleAnims);
CheckDlgButton(hWnd, IDC_LOGS, exp->enableLogs);
#ifdef UNICODE
//fill Shader mode combo box
SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_SETMINVISIBLE, 30, 0);
//.........这里部分代码省略.........
示例9: FaceDataDlgProc
static INT_PTR CALLBACK FaceDataDlgProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
EditFaceDataMod *em = (EditFaceDataMod *) GetWindowLongPtr (hWnd, GWLP_USERDATA);
ISpinnerControl *spin;
switch (msg) {
case WM_INITDIALOG:
em = (EditFaceDataMod*) lParam;
em->SetDialogHandle (hWnd);
SetWindowLongPtr (hWnd,GWLP_USERDATA,lParam);
spin = GetISpinner(GetDlgItem(hWnd,IDC_VALUE_SPIN));
spin->SetLimits (0.0f, 100.0f, FALSE);
spin->SetScale (0.1f);
spin->LinkToEdit (GetDlgItem(hWnd, IDC_VALUE), EDITTYPE_POS_FLOAT);
spin->SetValue (1.0f, FALSE);
spin->Disable();
ReleaseISpinner(spin);
CheckDlgButton (hWnd, IDC_COLLAPSABLE, em->GetCollapsable());
em->UpdateDialog ();
break;
case CC_SPINNER_BUTTONDOWN:
switch (LOWORD(wParam)) {
case IDC_VALUE_SPIN:
em->ChangeBegin ();
break;
}
break;
case CC_SPINNER_CHANGE:
spin = (ISpinnerControl*)lParam;
switch (LOWORD(wParam)) {
case IDC_VALUE_SPIN:
em->ChangeTo (spin->GetFVal());
break;
}
break;
case CC_SPINNER_BUTTONUP:
switch (LOWORD(wParam)) {
case IDC_VALUE_SPIN:
em->ChangeFinish (HIWORD(wParam) ? true : false);
break;
}
break;
case WM_CUSTEDIT_ENTER:
switch (LOWORD(wParam)) {
case IDC_VALUE:
em->ChangeFinish (true);
break;
}
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_RESET_SELECTION:
em->ResetSelection ();
break;
case IDC_COLLAPSABLE:
em->SetCollapsable (IsDlgButtonChecked (hWnd, IDC_COLLAPSABLE)?true:false);
break;
}
break;
case WM_PAINT:
// Good place for call to UpdateDialog, if needed.
return FALSE;
default:
return FALSE;
}
return TRUE;
}
示例10: ElMaxPluginDlgProc
static INT_PTR CALLBACK ElMaxPluginDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
theElMaxPlugin.Init(hWnd);
Interval animRange;
ISpinnerControl* spin;
int frameStart, frameEnd;
// Setup the spinner control for the static frame#
// We take the frame 0 as the default value
animRange = theElMaxPlugin.GetInterface()->GetAnimRange();
frameStart = animRange.Start() / GetTicksPerFrame();
frameEnd = animRange.End() / GetTicksPerFrame();
spin = GetISpinner(GetDlgItem(hWnd, IDC_STATIC_FRAME_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd,IDC_STATIC_FRAME), EDITTYPE_INT);
spin->SetLimits(frameStart, frameEnd, TRUE);
spin->SetScale(1.0f);
spin->SetValue(theElMaxPlugin.GetStaticFrame(), FALSE);
ReleaseISpinner(spin);
// Setup the spinner controls for the mesh animation start frame
spin = GetISpinner(GetDlgItem(hWnd, IDC_MESHANIM_START_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd, IDC_MESHANIM_START), EDITTYPE_INT);
spin->SetLimits(frameStart, frameEnd, TRUE);
spin->SetScale(1.0f);
spin->SetValue(frameStart, FALSE);
ReleaseISpinner(spin);
// Setup the spinner controls for the mesh animation end frame
spin = GetISpinner(GetDlgItem(hWnd, IDC_MESHANIM_END_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd, IDC_MESHANIM_END), EDITTYPE_INT);
spin->SetLimits(frameStart, frameEnd, TRUE);
spin->SetScale(1.0f);
spin->SetValue(frameEnd, FALSE);
ReleaseISpinner(spin);
// Setup the spinner controls for the mesh animation key sample rate
spin = GetISpinner(GetDlgItem(hWnd, IDC_MESHANIM_STEP_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd, IDC_MESHANIM_STEP), EDITTYPE_INT);
spin->SetLimits(1, 100, TRUE);
spin->SetScale(1.0f);
spin->SetValue(theElMaxPlugin.GetMeshAnimFrameStep(), FALSE);
ReleaseISpinner(spin);
// Setup the spinner controls for the skeletal animation start frame
spin = GetISpinner(GetDlgItem(hWnd, IDC_SKELETALANIM_START_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd, IDC_SKELETALANIM_START), EDITTYPE_INT);
spin->SetLimits(frameStart, frameEnd, TRUE);
spin->SetScale(1.0f);
spin->SetValue(frameStart, FALSE);
ReleaseISpinner(spin);
// Setup the spinner controls for the skeletal animation end frame
spin = GetISpinner(GetDlgItem(hWnd, IDC_SKELETALANIM_END_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd, IDC_SKELETALANIM_END), EDITTYPE_INT);
spin->SetLimits(frameStart, frameEnd, TRUE);
spin->SetScale(1.0f);
spin->SetValue(frameEnd, FALSE);
ReleaseISpinner(spin);
// Setup the spinner controls for the skeletal animation key sample rate
spin = GetISpinner(GetDlgItem(hWnd, IDC_SKELETALANIM_STEP_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd, IDC_SKELETALANIM_STEP), EDITTYPE_INT);
spin->SetLimits(1, 100, TRUE);
spin->SetScale(1.0f);
spin->SetValue(theElMaxPlugin.GetSkeletalAnimFrameStep(), FALSE);
ReleaseISpinner(spin);
}
break;
case WM_DESTROY:
theElMaxPlugin.Destroy(hWnd);
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_EXPORT_MESH:
if (HIWORD(wParam) == BN_CLICKED)
{
char filename[MAX_PATH] = {0};
if (GetSaveFileName(hWnd, filename, sizeof(filename), _T("ElMesh(*.ELM)\0*.ELM\0All(*.*)\0*.*\0"), _T("ELM"), _T("Mesh file to save")))
{
ISpinnerControl* spin = GetISpinner(GetDlgItem(hWnd, IDC_STATIC_FRAME_SPIN));
theElMaxPlugin.SetStaticFrame(spin->GetIVal());
ReleaseISpinner(spin);
theElMaxPlugin.ExportMesh(filename);
}
}
break;
case IDC_EXPORT_MESHANIM:
if (HIWORD(wParam) == BN_CLICKED)
{
char filename[MAX_PATH] = {0};
if (GetSaveFileName(hWnd, filename, sizeof(filename), _T("ElMeshAnimation(*.EMA)\0*.EMA\0All(*.*)\0*.*\0"), _T("EMA"), _T("MeshAnimation file to save")))
//.........这里部分代码省略.........
示例11: ExportOptionsDlgProc
// options dialog message handler
INT_PTR Options::ExportOptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM)
{
ISpinnerControl* spin;
// int ticksPerFrame = GetTicksPerFrame();
Interval animRange = mMaxInterface->GetAnimRange();
int sceneStart = animRange.Start();
int sceneEnd = animRange.End();
switch (message)
{
case WM_INITDIALOG: {
CenterWindow(hWnd, GetParent(hWnd));
// grab scene timing details & clip anim start & end if needed
if (mAnimationStart < sceneStart)
mAnimationStart = sceneStart;
if (mAnimationStart > sceneEnd)
mAnimationStart = sceneEnd;
if (mAnimationEnd < sceneStart)
mAnimationEnd = sceneStart;
if (mAnimationEnd > sceneEnd)
mAnimationEnd = sceneEnd;
// setup checkboxes
CheckDlgButton(hWnd, IDC_GEOM_NORMALS, mNormals);
CheckDlgButton(hWnd, IDC_GEOM_TRIANGLES, mTriangulate);
CheckDlgButton(hWnd, IDC_GEOM_XREFS, mIncludeXrefs);
CheckDlgButton(hWnd, IDC_GEOM_TANGENTS, mTangents);
CheckDlgButton(hWnd, IDC_ANIM_ENABLE, mAnimations);
CheckDlgButton(hWnd, IDC_ANIM_SAMPLE, mSampleAnimation);
CheckDlgButton(hWnd, IDC_ANIM_CLIP, mCreateClip);
CheckDlgButton(hWnd, IDC_LAYERS_TO_CLIPS, mLayersAsClips);
CheckDlgButton(hWnd, IDC_BAKE_MATRICES, mBakeMatrices);
CheckDlgButton(hWnd, IDC_RELATIVE_PATHS, mRelativePaths);
CheckDlgButton(hWnd, IDC_COPY_IMAGES, mCopyImages);
CheckDlgButton(hWnd, IDC_EXPORT_USER_PROPERTIES, mExportUserDefinedProperties);
// Animation checkboxes depend on the enable button.
EnableDlgControl(hWnd, IDC_ANIM_SAMPLE, mAnimations);
EnableDlgControl(hWnd, IDC_ANIM_CLIP, mAnimations);
#if defined(MAX_RELEASE_R17) && (MAX_RELEASE >= MAX_RELEASE_R17)
EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, mAnimations);
#else
EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, false);
#endif
// setup spinners
spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_START_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_START), EDITTYPE_TIME);
spin->SetLimits(sceneStart, sceneEnd, true);
spin->SetScale(1.0f);
spin->SetValue(mAnimationStart, true);
spin->Enable(mSampleAnimation && mAnimations);
EnableWindow(GetDlgItem(hWnd, IDC_START_LABEL), mSampleAnimation && mAnimations);
ReleaseISpinner(spin);
spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_END_SPIN));
spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_END), EDITTYPE_TIME);
spin->SetLimits(sceneStart, sceneEnd, true);
spin->SetScale(1.0f);
spin->SetValue(mAnimationEnd, false);
spin->Enable(mSampleAnimation && mAnimations);
EnableWindow(GetDlgItem(hWnd, IDC_END_LABEL), mSampleAnimation && mAnimations);
ReleaseISpinner(spin);
return true;
}
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_ANIM_ENABLE:
mAnimations = IsDlgButtonChecked(hWnd, IDC_ANIM_ENABLE) == BST_CHECKED;
EnableDlgControl(hWnd, IDC_ANIM_SAMPLE, mAnimations);
EnableDlgControl(hWnd, IDC_ANIM_CLIP, mAnimations);
#if defined(MAX_RELEASE_R17) && (MAX_RELEASE >= MAX_RELEASE_R17)
EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, mAnimations);
#else
EnableDlgControl(hWnd, IDC_LAYERS_TO_CLIPS, false);
#endif
/*spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_START_SPIN));
//spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_START), EDITTYPE_INT);
spin->Enable(sampleAnim && animations);
EnableWindow(GetDlgItem(hWnd, IDC_START_LABEL), sampleAnim && animations);
ReleaseISpinner(spin);
spin = GetISpinner(GetDlgItem(hWnd, IDC_ANIM_END_SPIN));
//spin->LinkToEdit(GetDlgItem(hWnd,IDC_ANIM_END), EDITTYPE_INT);
spin->Enable(sampleAnim && animations);
EnableWindow(GetDlgItem(hWnd, IDC_END_LABEL), sampleAnim && animations);
ReleaseISpinner(spin);
break; */
case IDC_ANIM_SAMPLE:
mSampleAnimation = IsDlgButtonChecked(hWnd, IDC_ANIM_SAMPLE) == BST_CHECKED;
//.........这里部分代码省略.........
示例12: ReadConfig
//.........这里部分代码省略.........
cfgFile.ReadInt (&m_nPreviewResX);
cfgFile.ReadInt (&m_nPreviewResY);
cfgFile.ReadFloat(&m_fViewportHeight);
cfgFile.ReadInt (&nValue);
m_bShowStats = nValue ? true : false;
cfgFile.ReadInt (&nValue);
m_bRenderToAvi = nValue ? true : false;
cfgFile.ReadStringZero(&m_strAviFile);
}
cfgFile.Close();
// Common
CheckDlgButton(m_hPanel, IDC_CHECK_PREPROCESSMESHES, m_bPreprocessMesh ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hPanel, IDC_CHECK_USELIGHTS, m_bUseLights ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(m_hPanel, IDC_RADIO_USEMAXKEYS), FALSE);
switch(m_eAnimType)
{
case ANIMATION_SAMPLING:
CheckRadioButton(m_hPanel, IDC_RADIO_USESAMPLING, IDC_RADIO_USEMAXKEYS, IDC_RADIO_USESAMPLING);
break;
case ANIMATION_MAXKEYS:
CheckRadioButton(m_hPanel, IDC_RADIO_USESAMPLING, IDC_RADIO_USEMAXKEYS, IDC_RADIO_USEMAXKEYS);
break;
}
pMaxSpin = GetISpinner(GetDlgItem(m_hPanel, IDC_SPIN_STARTTIME));
pMaxSpin->LinkToEdit(GetDlgItem(m_hPanel, IDC_EDIT_STARTTIME), EDITTYPE_FLOAT);
pMaxSpin->SetLimits(m_fStartTime, m_fEndTime, TRUE);
pMaxSpin->SetScale(0.01f);
pMaxSpin->SetValue(m_fStartTime, FALSE);
ReleaseISpinner(pMaxSpin);
pMaxSpin = GetISpinner(GetDlgItem(m_hPanel, IDC_SPIN_ENDTIME));
pMaxSpin->LinkToEdit(GetDlgItem(m_hPanel, IDC_EDIT_ENDTIME), EDITTYPE_FLOAT);
pMaxSpin->SetLimits(m_fStartTime, m_fEndTime, TRUE);
pMaxSpin->SetScale(0.01f);
pMaxSpin->SetValue(m_fEndTime, FALSE);
ReleaseISpinner(pMaxSpin);
pMaxSpin = GetISpinner(GetDlgItem(m_hPanel, IDC_SPIN_ANIMCHECKSTEP));
pMaxSpin->LinkToEdit(GetDlgItem(m_hPanel, IDC_EDIT_ANIMCHECKSTEP), EDITTYPE_INT);
pMaxSpin->SetLimits(0, 100, TRUE);
pMaxSpin->SetScale(1);
pMaxSpin->SetValue(m_nAnimCheckStep, FALSE);
ReleaseISpinner(pMaxSpin);
pMaxSpin = GetISpinner(GetDlgItem(m_hPanel, IDC_SPIN_POSSAMPLINGFREQ));
pMaxSpin->LinkToEdit(GetDlgItem(m_hPanel, IDC_EDIT_POSSAMPLINGFREQ), EDITTYPE_INT);
pMaxSpin->SetLimits(0, 100, TRUE);
pMaxSpin->SetScale(1);
pMaxSpin->SetValue(m_nNumPosSamplesPerSec, FALSE);
ReleaseISpinner(pMaxSpin);
pMaxSpin = GetISpinner(GetDlgItem(m_hPanel, IDC_SPIN_SCLSAMPLINGFREQ));
pMaxSpin->LinkToEdit(GetDlgItem(m_hPanel, IDC_EDIT_SCLSAMPLINGFREQ), EDITTYPE_INT);
pMaxSpin->SetLimits(0, 100, TRUE);
pMaxSpin->SetScale(1);
pMaxSpin->SetValue(m_nNumSclSamplesPerSec, FALSE);
ReleaseISpinner(pMaxSpin);