StraussShaderDlg::~StraussShaderDlg() { HDC hdc = GetDC(hRollup); GetGPort()->RestorePalette(hdc, hOldPal); ReleaseDC(hRollup, hdc); if( pShader ) pShader->SetParamDlg(NULL,0); for (long i=0; i < NMBUTS; i++ ){ ReleaseICustButton( texMBut[i] ); texMBut[i] = NULL; } for (long i=0; i<STRAUSS_NCOLBOX; i++) if (cs[i]) ReleaseIColorSwatch(cs[i]); // mjm - 5.10.99 ReleaseISpinner(glSpin); ReleaseISpinner(mtSpin); ReleaseISpinner(trSpin); DLSetWindowLongPtr(hRollup, NULL); DLSetWindowLongPtr(hwHilite, NULL); if(pShader){ IRollupWindow* pRollup = pMtlPar->GetMtlEditorRollup(); pShader->SetPanelOpen(pRollup->IsPanelOpen(pRollup->GetPanelIndex(hRollup))); } hwHilite = hRollup = NULL; }
void MorphObject::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev) { this->ip = ip; editOb = this; //pickMode = new PickTargCommandMode(this,ip); if (flags&BEGIN_EDIT_CREATE) { creating = TRUE; } else { creating = FALSE; } if (!hParams1) { hParams1 = ip->AddRollupPage( hInstance, MAKEINTRESOURCE(IDD_MORPHPARAM1), MorphParamDlgProc1, GetString(IDS_RB_PICKTARGETS), (LPARAM)this); ip->RegisterDlgWnd(hParams1); hParams2 = ip->AddRollupPage( hInstance, MAKEINTRESOURCE(IDD_MORPHPARAM2), MorphParamDlgProc2, GetString(IDS_RB_CURRENTTARGETS), (LPARAM)this); ip->RegisterDlgWnd(hParams1); } else { DLSetWindowLongPtr(hParams1, this); DLSetWindowLongPtr(hParams2, this); SetupTargetList(); SetTargMethod(addTargMethod); } }
void MorphObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next) { //ip->DeleteMode(pickMode); //delete pickMode; //pickMode = NULL; ip->ClearPickMode(); editOb = NULL; creating = FALSE; addTargMethod = AddTargMethod(); if (flags&END_EDIT_REMOVEUI) { ip->UnRegisterDlgWnd(hParams1); ip->DeleteRollupPage(hParams1); hParams1 = NULL; ip->UnRegisterDlgWnd(hParams2); ip->DeleteRollupPage(hParams2); hParams2 = NULL; } else { DLSetWindowLongPtr(hParams1, NULL); DLSetWindowLongPtr(hParams2, NULL); } ip = NULL; }
void TapeHelpObject::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) { iObjParams = ip; editting = TRUE; if ( !hTapeHelpParams ) { hTapeHelpParams = ip->AddRollupPage( hInstance, MAKEINTRESOURCE(IDD_TAPEHELPER), TapeHelpParamDialogProc, GetString(IDS_RB_PARAMETERS), (LPARAM)this ); ip->RegisterDlgWnd(hTapeHelpParams); } else { DLSetWindowLongPtr( hTapeHelpParams, this); // Init the dialog to our values. SetSpecLen( IsDlgButtonChecked(hTapeHelpParams,IDC_SPEC_LEN) ); if(specLenState) lengthSpin->SetValue( GetLength(ip->GetTime()), FALSE ); else lengthSpin->SetValue( lastDist, FALSE ); } }
static INT_PTR CALLBACK RendVueParamDlgProc( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { RendVueParamDlg *dlg = DLGetWindowLongPtr<RendVueParamDlg*>(hWnd); switch (msg) { case WM_INITDIALOG: dlg = (RendVueParamDlg*)lParam; DLSetWindowLongPtr(hWnd, lParam); break; case WM_LBUTTONDOWN: case WM_MOUSEMOVE: case WM_LBUTTONUP: dlg->ir->RollupMouseMessage(hWnd,msg,wParam,lParam); break; case WM_COMMAND: case IDC_RENDVUE_FILE: if (dlg->FileBrowse()) { SetDlgItemText(hWnd,IDC_RENDVUE_FILENAME, dlg->workFileName.data()); } break; case CC_SPINNER_CHANGE: { } break; } if (dlg) return dlg->WndProc(hWnd,msg,wParam,lParam); else return FALSE; }
// Dialog proc static INT_PTR CALLBACK ImportDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { AsciiImp *imp = DLGetWindowLongPtr<AsciiImp*>(hWnd); switch (msg) { case WM_INITDIALOG: imp = (AsciiImp*)lParam; DLSetWindowLongPtr(hWnd, lParam); CenterWindow(hWnd, GetParent(hWnd)); CheckDlgButton(hWnd, IDC_RESETSCENE, imp->resetScene); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: imp->resetScene = IsDlgButtonChecked(hWnd, IDC_RESETSCENE); EndDialog(hWnd, 1); break; case IDCANCEL: EndDialog(hWnd, 0); break; } break; default: return FALSE; } return TRUE; }
static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { CVDExporter *se = DLGetWindowLongPtr<CVDExporter*>(hWnd); if (!se && msg!=WM_INITDIALOG) return FALSE; switch (msg) { case WM_INITDIALOG: // Update class pointer se = (CVDExporter*)lParam; DLSetWindowLongPtr(hWnd, lParam); break; case WM_DESTROY: break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_OK: EndDialog(hWnd,1); break; } break; default: return FALSE; } return TRUE; }
// ============================================================================ LRESULT CALLBACK AngleControl::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { AngleControl *ctrl = DLGetWindowLongPtr<AngleControl*>(hWnd); if(ctrl == NULL && msg != WM_CREATE) return DefWindowProc(hWnd, msg, wParam, lParam); if(ctrl && ctrl->m_hToolTip) { MSG ttmsg; ttmsg.lParam = lParam; ttmsg.wParam = wParam; ttmsg.message = msg; ttmsg.hwnd = hWnd; SendMessage(ctrl->m_hToolTip, TTM_RELAYEVENT, 0, (LPARAM)(LPMSG)&ttmsg); } switch(msg) { case WM_CREATE: { LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam; ctrl = (AngleControl*)lpcs->lpCreateParams; DLSetWindowLongPtr(hWnd, ctrl); break; } case WM_LBUTTONDOWN: return ctrl->LButtonDown((short)LOWORD(lParam), (short)HIWORD(lParam), wParam); case WM_LBUTTONUP: return ctrl->LButtonUp((short)LOWORD(lParam), (short)HIWORD(lParam), wParam); case WM_RBUTTONUP: { Rollout* ro = ctrl->parent_rollout; HashTable* event_handlers= (HashTable*)ro->handlers->get(n_rightClick); if (event_handlers && (event_handlers->get(ctrl->name) != NULL)) ctrl->call_event_handler(ro, n_rightClick, NULL, 0); else ctrl->SetDegrees(0.f); } break; case WM_MOUSEMOVE: return ctrl->MouseMove((short)LOWORD(lParam), (short)HIWORD(lParam), wParam); case WM_ERASEBKGND: return ctrl->EraseBackground((HDC)wParam); case WM_PAINT: return ctrl->Paint(); default: return DefWindowProc(hWnd, msg, wParam, lParam); } return 0; }
static INT_PTR CALLBACK MouseDeviceDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { IMCParamDlg *dlg = DLGetWindowLongPtr<IMCParamDlg*>(hWnd); if (!dlg && msg!=WM_INITDIALOG) return FALSE; switch (msg) { case WM_INITDIALOG: dlg = (IMCParamDlg*)lParam; dlg->binding->UpdateRollup(dlg->iRoll); DLSetWindowLongPtr(hWnd, lParam); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_MOUSE_X: { MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding; b->which = MC_MOUSE_X; b->NotifyDependents(FOREVER,0,REFMSG_CHANGE); break; } case IDC_MOUSE_Y: { MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding; b->which = MC_MOUSE_Y; b->NotifyDependents(FOREVER,0,REFMSG_CHANGE); break; } case IDC_MOUSE_FLIP: { MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding; b->invert = IsDlgButtonChecked(hWnd,IDC_MOUSE_FLIP); b->NotifyDependents(FOREVER,0,REFMSG_CHANGE); break; } } break; case CC_SPINNER_CHANGE: { ISpinnerControl *spin = (ISpinnerControl *)lParam; MouseDeviceBinding *b = (MouseDeviceBinding*)dlg->binding; b->scale = spin->GetFVal(); b->NotifyDependents(FOREVER,0,REFMSG_CHANGE); break; } case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: dlg->iRoll->DlgMouseMessage(hWnd,msg,wParam,lParam); break; default: return FALSE; } return TRUE; }
INT_PTR CALLBACK TrackPropDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { BlockControl *blk = DLGetWindowLongPtr<BlockControl*>(hWnd); ISpinnerControl* spin = NULL; Rect rect; switch (msg) { case WM_INITDIALOG: { blk = (BlockControl*)lParam; DLSetWindowLongPtr(hWnd, 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; }
INT_PTR CALLBACK StaticDialogProc(HWND hwnd, UINT msg, WPARAM w, LPARAM l) { BitmapIO_BMP* p; if (msg==WM_INITDIALOG) { p = (BitmapIO_BMP*)l; DLSetWindowLongPtr(hwnd, l); } else { if ( (p = DLGetWindowLongPtr<BitmapIO_BMP*>(hwnd) ) == NULL ) return FALSE; } return p->ConfigCtrlDlgProc(hwnd,msg,w,l); }
static INT_PTR CALLBACK StraussShaderDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { StraussShaderDlg *theDlg; if (msg == WM_INITDIALOG) { theDlg = (StraussShaderDlg*)lParam; DLSetWindowLongPtr(hwndDlg, lParam); } else { if ( (theDlg = DLGetWindowLongPtr<StraussShaderDlg *>(hwndDlg) ) == NULL ) return FALSE; } theDlg->isActive = 1; BOOL res = theDlg->PanelProc(hwndDlg, msg, wParam, lParam); theDlg->isActive = 0; return res; }
void ProtHelpObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *prev) { editting = FALSE; if ( flags&END_EDIT_REMOVEUI ) { ip->UnRegisterDlgWnd(hProtHelpParams); ip->DeleteRollupPage(hProtHelpParams); hProtHelpParams = NULL; } else { DLSetWindowLongPtr( hProtHelpParams, 0); } iObjParams = NULL; }
static INT_PTR CALLBACK MorphParamDlgProc1( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { MorphObject *mo = DLGetWindowLongPtr<MorphObject*>(hWnd); if (!mo && message!=WM_INITDIALOG) return FALSE; switch (message) { case WM_INITDIALOG: { mo = (MorphObject*)lParam; DLSetWindowLongPtr(hWnd, lParam); mo->hParams1 = hWnd; ICustButton *iBut = GetICustButton(GetDlgItem(hWnd,IDC_PICK_MORPHTARG)); iBut->SetType(CBT_CHECK); iBut->SetHighlightColor(GREEN_WASH); ReleaseICustButton(iBut); mo->SetTargMethod(mo->addTargMethod); break; } case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_PICK_MORPHTARG: if (mo->ip->GetCommandMode()->ID() == CID_STDPICK) { if (mo->creating) { theCreateMorphMode.JumpStart(mo->ip,mo); mo->ip->SetCommandMode(&theCreateMorphMode); } else { mo->ip->SetStdCommandMode(CID_OBJMOVE); } } else { mo->pickCB.mo = mo; mo->ip->SetPickMode(&mo->pickCB); } break; } break; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: mo->ip->RollupMouseMessage(hWnd,message,wParam,lParam); return FALSE; default: return FALSE; } return TRUE; }
static INT_PTR CALLBACK ImageInfoDlg (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { BitmapIO_EPS *epsPtr; if (message == WM_INITDIALOG) { epsPtr = (BitmapIO_EPS *) lParam; DLSetWindowLongPtr(hWnd, epsPtr); } else epsPtr = DLGetWindowLongPtr<BitmapIO_EPS *>(hWnd); if (epsPtr) return epsPtr->ImageInfoProc (hWnd, message, wParam, lParam); else return FALSE; }
INT_PTR CALLBACK OutputCtrlDlgProc (HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam) { BitmapIO_EPS *epsPtr; if (message == WM_INITDIALOG) { epsPtr = (BitmapIO_EPS *) lParam; DLSetWindowLongPtr(hWnd, epsPtr); } else epsPtr = DLGetWindowLongPtr<BitmapIO_EPS *>(hWnd); if (epsPtr) return epsPtr->OutputControl (hWnd, message, wParam, lParam); else return FALSE; }
static void SaveAsColorFile(HWND hWnd) { TSTR *fileName = DLGetWindowLongPtr<TSTR*>(hWnd); if (fileName) _tcscpy(fname,fileName->data()); // RB 10/15/2000: Init directory string if (fdir[0]==_T('\0')) { _tcscpy(fdir, GetCOREInterface()->GetDir(APP_IMAGE_DIR)); } OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); FilterList fl; fl.Append(GetString(IDS_RB_COLORCLIPFILES)); fl.Append(_T("*.ccb")); TSTR title = GetString(IDS_RB_SAVECOLOR); ofn.lStructSize = sizeof(OPENFILENAME); // No OFN_ENABLEHOOK ofn.hwndOwner = hWnd; ofn.lpstrFilter = fl; ofn.lpstrFile = fname; ofn.nMaxFile = 256; ofn.lpstrInitialDir = fdir; ofn.Flags = OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST; ofn.FlagsEx = OFN_EX_NOPLACESBAR; ofn.lpstrDefExt = _T("ccb"); ofn.lpstrTitle = title; tryAgain: if (GetSaveFileName(&ofn)) { if (DoesFileExist(fname)) { TSTR buf1; TSTR buf2 = GetString(IDS_RB_SAVECOLOR); buf1.printf(GetString(IDS_RB_FILEEXISTS),fname); if (IDYES!=MessageBox( hWnd, buf1,buf2,MB_YESNO|MB_ICONQUESTION)) { goto tryAgain; } } if (!fileName) fileName = new TSTR; *fileName = fname; DLSetWindowLongPtr(hWnd, fileName); SaveColorFile(hWnd,*fileName); } }
void BombObject::EndEditParams(IObjParam *ip,ULONG flags,Animatable *next) { if (flags&END_EDIT_REMOVEUI) { ip->DeleteRollupPage(hParam); ip->DeleteRollupPage(hSot); hParam = NULL; hSot = NULL; } else { DLSetWindowLongPtr(hParam, 0); } if (GetFalloffOn(ip->GetTime())) { NotifyDependents(FOREVER,0,REFMSG_CHANGE); ip->RedrawViews(ip->GetTime()); } this->ip = NULL; }
void TapeHelpObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *prev) { editting = FALSE; if(specLenState) dlgLength = GetLength(ip->GetTime()); dlgSpecLen = IsDlgButtonChecked(hTapeHelpParams, IDC_SPEC_LEN); if ( flags&END_EDIT_REMOVEUI ) { ip->UnRegisterDlgWnd(hTapeHelpParams); ip->DeleteRollupPage(hTapeHelpParams); hTapeHelpParams = NULL; } else { DLSetWindowLongPtr( hTapeHelpParams, 0); } iObjParams = NULL; }
void ProtHelpObject::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) { iObjParams = ip; editting = TRUE; if ( !hProtHelpParams ) { hProtHelpParams = ip->AddRollupPage( hInstance, MAKEINTRESOURCE(IDD_PROTHELPER), ProtHelpParamDialogProc, GetString(IDS_RB_PARAMETERS), (LPARAM)this ); ip->RegisterDlgWnd(hProtHelpParams); } else { DLSetWindowLongPtr( hProtHelpParams, this); } UpdateUI(ip->GetTime()); }
INT_PTR CALLBACK DefaultSOTProc( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { IObjParam *ip = DLGetWindowLongPtr<IObjParam*>(hWnd); switch (msg) { case WM_INITDIALOG: DLSetWindowLongPtr(hWnd, lParam); break; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: if (ip) ip->RollupMouseMessage(hWnd,msg,wParam,lParam); return FALSE; default: return FALSE; } return TRUE; }
void BombObject::BeginEditParams(IObjParam *ip,ULONG flags,Animatable *prev) { this->ip = ip; if (!hParam) { hSot = ip->AddRollupPage( hInstance, MAKEINTRESOURCE(IDD_BOMB_SOT), DefaultSOTProc, GetString(IDS_RB_SOT), (LPARAM)ip,APPENDROLL_CLOSED); hParam = ip->AddRollupPage( hInstance, MAKEINTRESOURCE(IDD_BOMBPARAMS), BombParamProc, GetString(IDS_RB_BOMBPARAMS), (LPARAM)this ); } else { DLSetWindowLongPtr(hParam, this); // Init the dialog to our values. strengthSpin->SetValue(GetStrength(ip->GetTime()),FALSE); gravSpin->SetValue(GetGravity(ip->GetTime()),FALSE ); chaosSpin->SetValue(GetChaos(ip->GetTime()),FALSE ); detSpin->SetValue(GetDetonation(ip->GetTime()),FALSE ); spinSpin->SetValue(GetSpin(ip->GetTime()),FALSE); falloffSpin->SetValue(GetFalloff(ip->GetTime()),FALSE); minFragSpin->SetValue(GetMinFrag(ip->GetTime()),FALSE); maxFragSpin->SetValue(GetMaxFrag(ip->GetTime()),FALSE); seedSpin->SetValue(GetSeed(ip->GetTime()),FALSE); CheckDlgButton(hParam,IDC_FALLOFF_ON,GetFalloffOn(ip->GetTime())); } if (GetFalloffOn(ip->GetTime())) { NotifyDependents(FOREVER,0,REFMSG_CHANGE); ip->RedrawViews(ip->GetTime()); } }
INT_PTR CALLBACK SideBar1RollupDialogProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { UnwrapMod *mod = DLGetWindowLongPtr<UnwrapMod*>(hWnd); if ( !mod && message != WM_INITDIALOG ) return FALSE; BOOL processed = mod->GetUIManager()->MessageProc(hWnd,message,wParam,lParam); if (processed) return TRUE; switch ( message ) { case WM_INITDIALOG: { DLSetWindowLongPtr(hWnd, lParam); mod = (UnwrapMod*)lParam; } return TRUE; case WM_DESTROY: case WM_MOUSEACTIVATE: case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: return FALSE; /* case WM_COMMAND: switch (LOWORD(wParam)) { } */ } return FALSE; }
INT_PTR CALLBACK TapeHelpParamDialogProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { TapeHelpObject *th = DLGetWindowLongPtr<TapeHelpObject *>( hDlg); if ( !th && message != WM_INITDIALOG ) return FALSE; switch ( message ) { case WM_INITDIALOG: th = (TapeHelpObject *)lParam; DLSetWindowLongPtr( hDlg, th); SetDlgFont( hDlg, th->iObjParams->GetAppHFont() ); th->lengthSpin = GetISpinner(GetDlgItem(hDlg,IDC_LENSPINNER)); th->lengthSpin->SetLimits( MIN_TAPE_LEN, MAX_TAPE_LEN, FALSE ); // alexc - 03.06.09 - increments proportional to the spinner value th->lengthSpin->SetAutoScale(); if(th->specLenState) th->lengthSpin->SetValue( th->GetLength(th->iObjParams->GetTime()), FALSE ); else th->lengthSpin->SetValue( th->lastDist, FALSE ); th->lengthSpin->LinkToEdit( GetDlgItem(hDlg,IDC_LENGTH), EDITTYPE_UNIVERSE ); CheckDlgButton( hDlg, IDC_SPEC_LEN, th->specLenState ); EnableWindow(GetDlgItem(hDlg, IDC_LENGTH), th->specLenState); EnableWindow(GetDlgItem(hDlg, IDC_LENSPINNER), th->specLenState); return FALSE; case WM_DESTROY: ReleaseISpinner( th->lengthSpin ); return FALSE; case CC_SPINNER_BUTTONDOWN: theHold.Begin(); return TRUE; case CC_SPINNER_CHANGE: if (!theHold.Holding()) theHold.Begin(); switch ( LOWORD(wParam) ) { case IDC_LENSPINNER: th->SetLength( th->iObjParams->GetTime(), th->lengthSpin->GetFVal() ); th->lengthSpin->SetKeyBrackets(th->pblock->KeyFrameAtTime(PB_LENGTH,th->iObjParams->GetTime())); th->iObjParams->RedrawViews(th->iObjParams->GetTime(),REDRAW_INTERACTIVE); break; } return TRUE; case WM_CUSTEDIT_ENTER: case CC_SPINNER_BUTTONUP: if (HIWORD(wParam) || message==WM_CUSTEDIT_ENTER) theHold.Accept(GetString(IDS_DS_PARAMCHG)); else theHold.Cancel(); th->iObjParams->RedrawViews(th->iObjParams->GetTime(),REDRAW_END); return TRUE; case WM_MOUSEACTIVATE: th->iObjParams->RealizeParamPanel(); return FALSE; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: th->iObjParams->RollupMouseMessage(hDlg,message,wParam,lParam); return FALSE; case WM_COMMAND: switch( LOWORD(wParam) ) { case IDC_SPEC_LEN: th->SetSpecLen( IsDlgButtonChecked( hDlg, IDC_SPEC_LEN ) ); EnableWindow(GetDlgItem(hDlg, IDC_LENGTH), th->specLenState); EnableWindow(GetDlgItem(hDlg, IDC_LENSPINNER), th->specLenState); th->iObjParams->RedrawViews(th->iObjParams->GetTime()); break; } return FALSE; default: return FALSE; } }
INT_PTR CALLBACK MainDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { TSTR buf; RefWatch *rc = DLGetWindowLongPtr<RefWatch *>(hWnd); if (!rc && msg != WM_INITDIALOG ) return FALSE; switch (msg) { case WM_INITDIALOG: rc = (RefWatch *)lParam; DLSetWindowLongPtr(hWnd, rc); CenterWindow(hWnd, IP->GetMAXHWnd()); SetWindowText(GetDlgItem(hWnd, IDC_CLASSNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_CLIENTNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_ITEM_NAME), _T("")); SendMessage(GetDlgItem(hWnd, IDC_MSG_LIST), LB_RESETCONTENT, 0, 0L); return TRUE; case WM_CLOSE: DestroyWindow(rc->hMain); break; case WM_DESTROY: rc->DestroyWindow(); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_CLEAR: SendMessage(GetDlgItem(hWnd, IDC_MSG_LIST), LB_RESETCONTENT, 0, 0L); break; case IDC_TVPICK: { TSTR str; HWND hIRefList = GetDlgItem(hWnd, IDC_IREF_LIST); HWND hRefMeList = GetDlgItem(hWnd, IDC_REFME_LIST); TrackViewPick tvp; tvp.anim = tvp.client = NULL; BOOL ok = IP->TrackViewPickDlg(hWnd, &tvp); SetWindowText(GetDlgItem(hWnd, IDC_CLASSNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_CLIENTNAME), _T("")); if (ok) { if (tvp.anim && tvp.client) { rc->watchMe = tvp.anim; buf.printf(_T("Item Name: %s"), rc->GetName()); SetWindowText(GetDlgItem(hWnd, IDC_ITEM_NAME), buf.data()); notifyObject.RemoveReference(); notifyObject.CreateReference(rc->watchMe); tvp.anim->GetClassName(str); buf.printf(_T("This Target ClassName: %s"), str); SetWindowText(GetDlgItem(hWnd, IDC_CLASSNAME), buf.data()); tvp.client->GetClassName(str); buf.printf(_T("Client ClassName: %s"), str); SetWindowText(GetDlgItem(hWnd, IDC_CLIENTNAME), buf.data()); Tab<TSTR *> ptStr; TSTR *pTstr, Str(_T("")); pTstr = &Str; ptStr.Append(1, &pTstr); DisplayRefInfo(rc, hWnd, &ptStr); SendMessage(GetDlgItem(hWnd, IDC_MSG_LIST), LB_RESETCONTENT, 0, 0L); } else ok = FALSE; } if (!ok) { rc->watchMe = NULL; notifyObject.RemoveReference(); SendMessage(hIRefList, LB_RESETCONTENT, 0, 0L); SendMessage(hRefMeList, LB_RESETCONTENT, 0, 0L); SendMessage(GetDlgItem(hWnd, IDC_MSG_LIST), LB_RESETCONTENT, 0, 0L); SetWindowText(GetDlgItem(hWnd, IDC_CLASSNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_CLIENTNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_ITEM_NAME), _T("")); } break; }; return TRUE; case IDC_REFME_LIST: case IDC_IREF_LIST: if (HIWORD(wParam) == LBN_DBLCLK) { TSTR str; HWND hIRefList = GetDlgItem(hWnd, IDC_IREF_LIST); HWND hRefMeList = GetDlgItem(hWnd, IDC_REFME_LIST); BOOL ok = TRUE; // Get list item. HWND listbox = (HWND)lParam; int i = SendMessage(listbox, LB_GETCURSEL, 0, 0); // Change the currently watched object. if (LOWORD(wParam) == IDC_IREF_LIST) rc->watchMe = rc->watchMe->GetReference(i); else { bool fulltree = IsDlgButtonChecked(hWnd, IDC_FULLTREE) ? true : false; if (fulltree) { // Enum dependents. RefCheckFindDepEnumProc rfep(i, rc->watchMe); rc->watchMe->DoEnumDependents(&rfep); if (rfep.rmaker != NULL) { if (!OkToDisplay(hWnd, rfep.rmaker)) return TRUE; rc->watchMe = (ReferenceTarget*)rfep.rmaker; } else ok = FALSE; } else { // We only displayed first-level dependents. int count = 0; DependentIterator di(rc->watchMe); ReferenceMaker* maker = NULL; while ((maker = di.Next()) != NULL) { if (count == i) { if (!OkToDisplay(hWnd, maker)) return TRUE; rc->watchMe = (ReferenceTarget*)maker; break; } if (count > i) return TRUE;// not sure how this could happen... ++count; } } } SetWindowText(GetDlgItem(hWnd, IDC_CLASSNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_CLIENTNAME), _T("")); if (ok) { buf.printf(_T("Item Name: %s"), rc->GetName()); SetWindowText(GetDlgItem(hWnd, IDC_ITEM_NAME), buf.data()); notifyObject.RemoveReference(); notifyObject.CreateReference(rc->watchMe); rc->watchMe->GetClassName(str); buf.printf(_T("This Target ClassName: %s"), str); SetWindowText(GetDlgItem(hWnd, IDC_CLASSNAME), buf.data()); buf.printf(_T("Client ClassName: %s"), _T("(Unable to determine)")); SetWindowText(GetDlgItem(hWnd, IDC_CLIENTNAME), buf.data()); Tab<TSTR *> ptStr; TSTR *pTstr, Str(_T("")); pTstr = &Str; ptStr.Append(1, &pTstr); DisplayRefInfo(rc, hWnd, &ptStr); SendMessage(GetDlgItem(hWnd, IDC_MSG_LIST), LB_RESETCONTENT, 0, 0L); } else { rc->watchMe = NULL; notifyObject.RemoveReference(); SendMessage(hIRefList, LB_RESETCONTENT, 0, 0L); SendMessage(hRefMeList, LB_RESETCONTENT, 0, 0L); SendMessage(GetDlgItem(hWnd, IDC_MSG_LIST), LB_RESETCONTENT, 0, 0L); SetWindowText(GetDlgItem(hWnd, IDC_CLASSNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_CLIENTNAME), _T("")); SetWindowText(GetDlgItem(hWnd, IDC_ITEM_NAME), _T("")); } } break; }; break; default: return FALSE; }; return TRUE; }
INT_PTR CALLBACK ProtHelpParamDialogProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { ICustButton *iBut = NULL; ProtHelpObject *ph = DLGetWindowLongPtr<ProtHelpObject *>( hDlg); if ( !ph && message != WM_INITDIALOG ) return FALSE; switch ( message ) { case WM_INITDIALOG: ph = (ProtHelpObject *)lParam; DLSetWindowLongPtr( hDlg, ph); SetDlgFont( hDlg, ph->iObjParams->GetAppHFont() ); iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET1)); if( iBut != NULL) { iBut->SetType (CBT_CHECK); iBut->SetHighlightColor (GREEN_WASH); ReleaseICustButton(iBut); } iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET2)); if( iBut != NULL) { iBut->SetType (CBT_CHECK); iBut->SetHighlightColor (GREEN_WASH); ReleaseICustButton(iBut); } return FALSE; case WM_DESTROY: return FALSE; case WM_MOUSEACTIVATE: ph->iObjParams->RealizeParamPanel(); return FALSE; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: ph->iObjParams->RollupMouseMessage(hDlg,message,wParam,lParam); return FALSE; case WM_COMMAND: switch( LOWORD(wParam) ) { case IDC_PROT_PICK_TARGET1: case IDC_PROT_PICK_TARGET2: if(ph->created == FALSE) { iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET1)); if(iBut != NULL) { iBut->SetCheck(FALSE); ReleaseICustButton(iBut); } iBut = GetICustButton(GetDlgItem(hDlg, IDC_PROT_PICK_TARGET2)); if(iBut != NULL) { iBut->SetCheck(FALSE); ReleaseICustButton(iBut); } break; } pickCB.ph = ph; pickCB.hDlg = hDlg; if(pickCB.doingPick) ph->iObjParams->SetCommandMode(pickCB.cm); else pickCB.cm = ph->iObjParams->GetCommandMode(); pickCB.which = ((LOWORD(wParam) - IDC_PROT_PICK_TARGET1) > 0); ph->iObjParams->SetPickMode (&pickCB); ph->UpdateUI(ph->iObjParams->GetTime()); ph->iObjParams->RedrawViews (ph->iObjParams->GetTime()); break; } return FALSE; default: return FALSE; } }
/** * 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); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_ADDSTRING, 0, (LPARAM)L"None"); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_ADDSTRING, 0, (LPARAM)L"Only for Normal/Specular"); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_ADDSTRING, 0, (LPARAM)L"All materials (3 lights)"); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_ADDSTRING, 0, (LPARAM)L"All materials (multi pass)"); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_SETCURSEL, (int)exp->exportProgram, 0); //fill Max texture size combo box SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_SETMINVISIBLE, 30, 0); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)L"64"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)L"128"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)L"256"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)L"512"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)L"1024"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)L"2048"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)L"4096"); //fill Mipmaps combo box SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_SETMINVISIBLE, 30, 0); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)L"Max"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)L"None"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)L"2"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)L"4"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)L"8"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)L"16"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)L"32"); #else //fill Shader mode combo box SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_SETMINVISIBLE, 30, 0); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_ADDSTRING, 0, (LPARAM)"None"); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_ADDSTRING, 0, (LPARAM)"Only for Normal/Specular"); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_ADDSTRING, 0, (LPARAM)"All materials"); SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_SETCURSEL, (int)exp->exportProgram, 0); //fill Max texture size combo box SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_SETMINVISIBLE, 30, 0); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)"64"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)"128"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)"256"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)"512"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)"1024"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)"2048"); SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_ADDSTRING, 0, (LPARAM)"4096"); //fill Max texture size combo box SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_SETMINVISIBLE, 30, 0); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)"Max"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)"None"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)"2"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)"4"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)"8"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)"16"); SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_ADDSTRING, 0, (LPARAM)"32"); #endif // Enable or disable the DDS options EnableWindow(GetDlgItem(hWnd, IDC_TEXSIZE), exp->convertToDDS ? TRUE : FALSE); EnableWindow(GetDlgItem(hWnd, IDC_NUMMIPS), exp->convertToDDS ? TRUE : FALSE); int texSel = 0; if (exp->maxTextureSize == 128) texSel = 1; else if (exp->maxTextureSize == 256) texSel = 2; else if (exp->maxTextureSize == 512) texSel = 3; else if (exp->maxTextureSize == 1024) texSel = 4; else if (exp->maxTextureSize == 2048) texSel = 5; else if (exp->maxTextureSize == 4096) texSel = 6; SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_SETCURSEL, texSel, 0); int mipsSel = 0; if (exp->maxMipmaps == -1) mipsSel = 0; else if (exp->maxMipmaps == 0) mipsSel = 1; else if (exp->maxMipmaps == 2) mipsSel = 2; else if (exp->maxMipmaps == 4) mipsSel = 3; else if (exp->maxMipmaps == 8) mipsSel = 4; else if (exp->maxMipmaps == 16) mipsSel = 5; else if (exp->maxMipmaps == 32) mipsSel = 6; SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_SETCURSEL, mipsSel, 0); //Versioning TCHAR Title[256]; _stprintf(Title, _T("Easy Ogre Exporter version %.2f"), EXVERSION); SetWindowText(hWnd, Title); return TRUE; } case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_CONVDDS: { // Enable or disable the DDS options exp->convertToDDS = IsDlgButtonChecked(hWnd, IDC_CONVDDS) ? true : false; EnableWindow(GetDlgItem(hWnd, IDC_TEXSIZE), exp->convertToDDS ? TRUE : FALSE); EnableWindow(GetDlgItem(hWnd, IDC_NUMMIPS), exp->convertToDDS ? TRUE : FALSE); } break; case IDOK: { // LRESULT 在 64 位机器上是 _int64 int ogreVerIdx = (int)SendDlgItemMessage(hWnd, IDC_OGREVERSION, CB_GETCURSEL, 0, 0); if (ogreVerIdx != CB_ERR) { switch (ogreVerIdx) { case 0: exp->meshVersion = TOGRE_LASTEST; break; case 1: exp->meshVersion = TOGRE_1_8; break; case 2: exp->meshVersion = TOGRE_1_7; break; case 3: exp->meshVersion = TOGRE_1_4; break; case 4: exp->meshVersion = TOGRE_1_0; break; default: exp->meshVersion = TOGRE_1_8; } } TSTR temp; int len = 0; len = (int)SendDlgItemMessage(hWnd, IDC_RESPREFIX, WM_GETTEXTLENGTH, 0, 0); temp.Resize(len + 1); SendDlgItemMessage(hWnd, IDC_RESPREFIX, WM_GETTEXT, len + 1, (LPARAM)temp.data()); #ifdef UNICODE std::wstring temp_w = temp.data(); std::string temp_s; temp_s.assign(temp_w.begin(), temp_w.end()); exp->resPrefix = temp_s; #else exp->resPrefix = temp; #endif len = (int)SendDlgItemMessage(hWnd, IDC_MATDIR, WM_GETTEXTLENGTH, 0, 0); temp.Resize(len + 1); SendDlgItemMessage(hWnd, IDC_MATDIR, WM_GETTEXT, len + 1, (LPARAM)temp.data()); #ifdef UNICODE temp_w = temp.data(); temp_s.assign(temp_w.begin(), temp_w.end()); exp->materialOutputDir = temp_s; #else exp->materialOutputDir = temp; #endif len = (int)SendDlgItemMessage(hWnd, IDC_TEXDIR, WM_GETTEXTLENGTH, 0, 0); temp.Resize(len + 1); SendDlgItemMessage(hWnd, IDC_TEXDIR, WM_GETTEXT, len + 1, (LPARAM)temp.data()); #ifdef UNICODE temp_w = temp.data(); temp_s.assign(temp_w.begin(), temp_w.end()); exp->texOutputDir = temp_s; #else exp->texOutputDir = temp; #endif len = (int)SendDlgItemMessage(hWnd, IDC_MESHDIR, WM_GETTEXTLENGTH, 0, 0); temp.Resize(len + 1); SendDlgItemMessage(hWnd, IDC_MESHDIR, WM_GETTEXT, len + 1, (LPARAM)temp.data()); #ifdef UNICODE temp_w = temp.data(); temp_s.assign(temp_w.begin(), temp_w.end()); exp->meshOutputDir = temp_s; #else exp->meshOutputDir = temp; #endif len = (int)SendDlgItemMessage(hWnd, IDC_PROGDIR, WM_GETTEXTLENGTH, 0, 0); temp.Resize(len + 1); SendDlgItemMessage(hWnd, IDC_PROGDIR, WM_GETTEXT, len + 1, (LPARAM)temp.data()); #ifdef UNICODE temp_w = temp.data(); temp_s.assign(temp_w.begin(), temp_w.end()); exp->programOutputDir = temp_s; #else exp->programOutputDir = temp; #endif spin = GetISpinner(GetDlgItem(hWnd, IDC_RESAMPLE_SPIN)); exp->resampleStep = spin->GetIVal(); ReleaseISpinner(spin); exp->yUpAxis = IsDlgButtonChecked(hWnd, IDC_YUPAXIS) ? true : false; exp->useSharedGeom = IsDlgButtonChecked(hWnd, IDC_SHAREDGEOM) ? true : false; exp->generateLOD = IsDlgButtonChecked(hWnd, IDC_GENLOD) ? true : false; exp->buildEdges = IsDlgButtonChecked(hWnd, IDC_EDGELIST) ? true : false; exp->buildTangents = IsDlgButtonChecked(hWnd, IDC_TANGENT) ? true : false; exp->tangentsSplitMirrored = IsDlgButtonChecked(hWnd, IDC_SPLITMIRROR) ? true : false; exp->tangentsSplitRotated = IsDlgButtonChecked(hWnd, IDC_SPLITROT) ? true : false; exp->tangentsUseParity = IsDlgButtonChecked(hWnd, IDC_STOREPARITY) ? true : false; exp->convertToDDS = IsDlgButtonChecked(hWnd, IDC_CONVDDS) ? true : false; exp->resampleAnims = IsDlgButtonChecked(hWnd, IDC_RESAMPLE_ANIMS) ? true : false; exp->enableLogs = IsDlgButtonChecked(hWnd, IDC_LOGS) ? true : false; int shaderIdx = (int)SendDlgItemMessage(hWnd, IDC_SHADERMODE, CB_GETCURSEL, 0, 0); if (shaderIdx != CB_ERR) { switch (shaderIdx) { case 0: exp->exportProgram = SHADER_NONE; break; case 1: exp->exportProgram = SHADER_BUMP; break; case 2: exp->exportProgram = SHADER_ALL; break; case 3: exp->exportProgram = SHADER_ALL_MULTI; break; default: exp->exportProgram = SHADER_BUMP; } } int texIdx = (int)SendDlgItemMessage(hWnd, IDC_TEXSIZE, CB_GETCURSEL, 0, 0); if (texIdx != CB_ERR) { switch (texIdx) { case 0: exp->maxTextureSize = 64; break; case 1: exp->maxTextureSize = 128; break; case 2: exp->maxTextureSize = 256; break; case 3: exp->maxTextureSize = 512; break; case 4: exp->maxTextureSize = 1024; break; case 5: exp->maxTextureSize = 2048; break; case 6: exp->maxTextureSize = 4096; break; default: exp->maxTextureSize = 2048; } } int mipsIdx = (int)SendDlgItemMessage(hWnd, IDC_NUMMIPS, CB_GETCURSEL, 0, 0); if (mipsIdx != CB_ERR) { switch (mipsIdx) { case 0: exp->maxMipmaps = -1; break; case 1: exp->maxMipmaps = 0; break; case 2: exp->maxMipmaps = 2; break; case 3: exp->maxMipmaps = 4; break; case 4: exp->maxMipmaps = 8; break; case 5: exp->maxMipmaps = 16; break; case 6: exp->maxMipmaps = 32; break; default: exp->maxMipmaps = -1; } } EndDialog(hWnd, 1); } break; case IDCANCEL: EndDialog(hWnd, 0); break; } default: return FALSE; } return TRUE; }
// Dialog proc static INT_PTR CALLBACK ExportDlgProc(HWND hWnd, UINT msg,WPARAM wParam, LPARAM lParam) { GmodelExp *exp = DLGetWindowLongPtr<GmodelExp*>(hWnd); switch (msg) { case WM_INITDIALOG: exp = (GmodelExp*)lParam; DLSetWindowLongPtr(hWnd, lParam); CenterWindow(hWnd, GetParent(hWnd)); CheckDlgButton(hWnd, IDC_MATERIAL, exp->m_bExportMaterial); CheckDlgButton(hWnd, IDC_MESHDATA, exp->m_bExportMesh); CheckDlgButton(hWnd, IDC_NORMALS, exp->m_bExportVertexNormals); CheckDlgButton(hWnd, IDC_TEXCOORDS,exp->m_bExportVertexUVs); CheckDlgButton(hWnd, IDC_VERTEXCOLORS,exp->m_bExportVertexColors); CheckDlgButton(hWnd, IDC_TANGENTSPACE,exp->m_bExportTangentSpace); // Enable / disable mesh options EnableWindow(GetDlgItem(hWnd, IDC_NORMALS), exp->m_bExportMesh); EnableWindow(GetDlgItem(hWnd, IDC_TEXCOORDS), exp->m_bExportMesh); EnableWindow(GetDlgItem(hWnd, IDC_VERTEXCOLORS), exp->m_bExportMesh); EnableWindow(GetDlgItem(hWnd, IDC_TANGENTSPACE), exp->m_bExportMesh); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_MESHDATA: // Enable / disable mesh options EnableWindow(GetDlgItem(hWnd, IDC_NORMALS), IsDlgButtonChecked(hWnd, IDC_MESHDATA)); EnableWindow(GetDlgItem(hWnd, IDC_TEXCOORDS), IsDlgButtonChecked(hWnd, IDC_MESHDATA)); EnableWindow(GetDlgItem(hWnd, IDC_VERTEXCOLORS), IsDlgButtonChecked(hWnd, IDC_MESHDATA)); EnableWindow(GetDlgItem(hWnd, IDC_TANGENTSPACE), IsDlgButtonChecked(hWnd, IDC_MESHDATA)); break; case IDOK: exp->m_bExportMesh = IsDlgButtonChecked(hWnd, IDC_MESHDATA); exp->m_bExportMaterial = IsDlgButtonChecked(hWnd, IDC_MATERIAL); exp->m_bExportVertexNormals = IsDlgButtonChecked(hWnd, IDC_NORMALS); exp->m_bExportVertexUVs = IsDlgButtonChecked(hWnd, IDC_TEXCOORDS); exp->m_bExportVertexColors = IsDlgButtonChecked(hWnd, IDC_VERTEXCOLORS); exp->m_bExportTangentSpace = IsDlgButtonChecked(hWnd, IDC_TANGENTSPACE); EndDialog(hWnd, 1); break; case IDCANCEL: EndDialog(hWnd, 0); break; } break; default: return FALSE; } return TRUE; }
static INT_PTR CALLBACK MorphParamDlgProc2( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { MorphObject *mo = DLGetWindowLongPtr<MorphObject*>(hWnd); if (!mo && message!=WM_INITDIALOG) return FALSE; switch (message) { case WM_INITDIALOG: { mo = (MorphObject*)lParam; DLSetWindowLongPtr(hWnd, lParam); mo->hParams2 = hWnd; mo->SetupTargetList(); break; } case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_CREATE_MORPHKEY: { TSTR name; Matrix3 tm = mo->morphCont->GetMorphTargTM(mo->sel); SetMorphTargetPacket pckt( mo->morphCont->GetMorphTarg(mo->sel),name, tm,TRUE); theHold.Begin(); mo->morphCont->SetValue(mo->ip->GetTime(),&pckt); theHold.Accept(GetString(IDS_RB_CREATEMORPHKEY)); mo->ip->RedrawViews(mo->ip->GetTime()); break; } case IDC_MORPHTARG_LIST: if (HIWORD(wParam)==LBN_SELCHANGE) { mo->sel = SendMessage( GetDlgItem(mo->hParams2,IDC_MORPHTARG_LIST), LB_GETCURSEL,0,0); if (mo->sel < 0) { EnableWindow(GetDlgItem(hWnd,IDC_CREATE_MORPHKEY),FALSE); EnableWindow(GetDlgItem(hWnd,IDC_DELETE_MORPHTARG),FALSE); ICustEdit *edit = GetICustEdit(GetDlgItem(hWnd,IDC_MORPHTARG_NAME)); edit->Disable(); edit->SetText(_T("")); ReleaseICustEdit(edit); } else { EnableWindow(GetDlgItem(hWnd,IDC_CREATE_MORPHKEY),TRUE); EnableWindow(GetDlgItem(hWnd,IDC_DELETE_MORPHTARG),TRUE); ICustEdit *edit = GetICustEdit(GetDlgItem(hWnd,IDC_MORPHTARG_NAME)); edit->Enable(); edit->SetText(mo->SubAnimName(mo->sel)); ReleaseICustEdit(edit); } mo->NotifyDependents(FOREVER,(PartID) mo,REFMSG_BRANCHED_HISTORY_CHANGED); } break; case IDC_DELETE_MORPHTARG: if (mo->sel>=0) { theHold.Begin(); mo->morphCont->DeleteMorphTarg(mo->sel); theHold.Accept(GetString(IDS_RB_DELETEMORPHTARG)); mo->sel = -1; mo->SetupTargetList(); mo->ip->RedrawViews(mo->ip->GetTime()); //GetSystemSetting(SYSSET_CLEAR_UNDO); } break; } break; case WM_CUSTEDIT_ENTER: if (LOWORD(wParam)==IDC_MORPHTARG_NAME && mo->sel >= 0) { ICustEdit *edit = GetICustEdit(GetDlgItem(hWnd,IDC_MORPHTARG_NAME)); TCHAR buf[256]; edit->GetText(buf,256); mo->morphCont->SetMorphTargName(mo->sel,TSTR(buf)); mo->SetupTargetList(); mo->NotifyDependents(FOREVER,0,REFMSG_SUBANIM_STRUCTURE_CHANGED); ReleaseICustEdit(edit); } break; case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: mo->ip->RollupMouseMessage(hWnd,message,wParam,lParam); return FALSE; default: return FALSE; } return TRUE; }
INT_PTR CALLBACK ConfigCtrlDlgProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam) { BitmapIO_PNG *th = DLGetWindowLongPtr<BitmapIO_PNG *>( hWnd); if ( !th && message != WM_INITDIALOG ) return FALSE; switch (message) { case WM_INITDIALOG: th = (BitmapIO_PNG *)lParam; DLSetWindowLongPtr( hWnd, th); if (!th->cfg.saved) th->ReadCfg(); th->dlgcfg.color_type = th->cfg.color_type; th->dlgcfg.bitdepth = th->cfg.bitdepth; th->dlgcfg.interlaced = th->cfg.interlaced; // first interlaced CheckDlgButton( hWnd, IDC_PNG_INTERLACE, th->dlgcfg.interlaced); // now alpha switch (th->dlgcfg.color_type) { case PngPalette: EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), FALSE); break; case PngRGB: case PngGray: EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), TRUE); CheckDlgButton( hWnd, IDC_PNG_ALPHA, FALSE); break; case PngRGBA: case PngGrayA: EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), TRUE); CheckDlgButton( hWnd, IDC_PNG_ALPHA, TRUE); break; } switch (th->dlgcfg.color_type) { case PngPalette: CheckDlgButton( hWnd, IDC_PNG_PALETTE, TRUE ); break; case PngRGB: case PngRGBA: if (th->dlgcfg.bitdepth == 8) CheckDlgButton( hWnd, IDC_PNG_RGB24, TRUE ); else CheckDlgButton( hWnd, IDC_PNG_RGB48, TRUE ); break; case PngGray: case PngGrayA: if (th->dlgcfg.bitdepth == 8) CheckDlgButton( hWnd, IDC_PNG_GRAY8, TRUE ); else CheckDlgButton( hWnd, IDC_PNG_GRAY16, TRUE ); break; } case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: th->cfg.color_type = th->dlgcfg.color_type; th->cfg.bitdepth = th->dlgcfg.bitdepth; th->cfg.interlaced = th->dlgcfg.interlaced; th->WriteCfg(); EndDialog(hWnd,1); break; case IDCANCEL: EndDialog(hWnd,0); break; case IDC_PNG_PALETTE: th->dlgcfg.color_type = PngPalette; th->dlgcfg.bitdepth = 8; EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), FALSE); break; case IDC_PNG_RGB24: if (IsDlgButtonChecked(hWnd, IDC_PNG_ALPHA)) th->dlgcfg.color_type = PngRGBA; else th->dlgcfg.color_type = PngRGB; th->dlgcfg.bitdepth = 8; EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), TRUE); break; case IDC_PNG_RGB48: if (IsDlgButtonChecked(hWnd, IDC_PNG_ALPHA)) th->dlgcfg.color_type = PngRGBA; else th->dlgcfg.color_type = PngRGB; th->dlgcfg.bitdepth = 16; EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), TRUE); break; case IDC_PNG_GRAY8: if (IsDlgButtonChecked(hWnd, IDC_PNG_ALPHA)) th->dlgcfg.color_type = PngGrayA; else th->dlgcfg.color_type = PngGray; th->dlgcfg.bitdepth = 8; EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), TRUE); break; case IDC_PNG_GRAY16: if (IsDlgButtonChecked(hWnd, IDC_PNG_ALPHA)) th->dlgcfg.color_type = PngGrayA; else th->dlgcfg.color_type = PngGray; th->dlgcfg.bitdepth = 16; EnableWindow(GetDlgItem(hWnd,IDC_PNG_ALPHA), TRUE); break; case IDC_PNG_INTERLACE: th->dlgcfg.interlaced = IsDlgButtonChecked(hWnd, IDC_PNG_INTERLACE); break; case IDC_PNG_ALPHA: switch(th->dlgcfg.color_type) { case PngRGB: case PngRGBA: if (IsDlgButtonChecked(hWnd, IDC_PNG_ALPHA)) th->dlgcfg.color_type = PngRGBA; else th->dlgcfg.color_type = PngRGB; break; case PngGray: case PngGrayA: if (IsDlgButtonChecked(hWnd, IDC_PNG_ALPHA)) th->dlgcfg.color_type = PngGrayA; else th->dlgcfg.color_type = PngGray; break; } break; } return 1; } return 0; }