Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <3dsmaxport.h>
- class RenderThingTestRendParamDlg : public RendParamDlg {
- public:
- RenderThingTest *rend;
- IRendParams *ir;
- BOOL prog;
- HFONT hFont;
- HWND hPanel;
- RenderThingTestRendParamDlg(RenderThingTest *r, IRendParams *irp, BOOL prog);
- ~RenderThingTestRendParamDlg();
- void AcceptParams();
- void RejectParams();
- void DeleteThis() {delete this;}
- void InitParamDialog(HWND hWnd);
- };
- static const Class_ID renderTabClassID(0x41f474c8, 0x4a41042c);
- static INT_PTR CALLBACK RenderThingTestRendParamDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- // Bool prog indicates if a render is in progress
- // in that case, controls should be read-only
- RenderThingTestRendParamDlg::RenderThingTestRendParamDlg(RenderThingTest *r, IRendParams *ir, BOOL prog) {
- hFont = CreateFont(14,0,0,0,FW_BOLD,0,0,0,0,0,0,0, VARIABLE_PITCH | FF_SWISS, _T(""));
- rend = r;
- this->ir = ir;
- this->prog = prog;
- // TODO: Check prog before adding rollup
- hPanel = ir->AddTabRollupPage(
- renderTabClassID,
- hInstance,
- MAKEINTRESOURCE(IDD_PANEL),
- RenderThingTestRendParamDlgProc,
- _T("RenderThing Render"),
- (LPARAM)this);
- }
- RenderThingTestRendParamDlg::~RenderThingTestRendParamDlg() {
- DeleteObject(hFont);
- ir->DeleteRollupPage(hPanel);
- }
- void RenderThingTestRendParamDlg::AcceptParams() {
- // TODO
- }
- void RenderThingTestRendParamDlg::RejectParams() {
- // TODO
- }
- void RenderThingTestRendParamDlg::InitParamDialog(HWND hWnd) {
- // TODO: Initialize controls to what the params indicate
- }
- // Windows callback
- static INT_PTR CALLBACK RenderThingTestRendParamDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
- RenderThingTestRendParamDlg *dlg = DLGetWindowLongPtr<RenderThingTestRendParamDlg*>(hWnd);
- switch (msg) {
- case WM_INITDIALOG:
- dlg = (RenderThingTestRendParamDlg*)lParam;
- DLSetWindowLongPtr(hWnd, lParam);
- if (dlg) {
- // TODO: add check for prog
- dlg->InitParamDialog(hWnd);
- }
- break;
- case WM_DESTROY:
- break;
- case WM_COMMAND:
- break;
- case WM_LBUTTONDOWN:
- case WM_MOUSEMOVE:
- case WM_LBUTTONUP:
- dlg->ir->RollupMouseMessage(hWnd, msg, wParam, lParam);
- break;
- default:
- return FALSE;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment