Guest User

Untitled

a guest
Sep 9th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.21 KB | None | 0 0
  1. #include <3dsmaxport.h>
  2.  
  3. class RenderThingTestRendParamDlg : public RendParamDlg {
  4. public:
  5.     RenderThingTest *rend;
  6.     IRendParams *ir;
  7.     BOOL prog;
  8.     HFONT hFont;
  9.     HWND hPanel;
  10.  
  11.     RenderThingTestRendParamDlg(RenderThingTest *r, IRendParams *irp, BOOL prog);
  12.     ~RenderThingTestRendParamDlg();
  13.     void AcceptParams();
  14.     void RejectParams();
  15.     void DeleteThis() {delete this;}
  16.     void InitParamDialog(HWND hWnd);
  17. };
  18.  
  19. static const Class_ID renderTabClassID(0x41f474c8, 0x4a41042c);
  20.  
  21. static INT_PTR CALLBACK RenderThingTestRendParamDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  22.  
  23. // Bool prog indicates if a render is in progress
  24. // in that case, controls should be read-only
  25. RenderThingTestRendParamDlg::RenderThingTestRendParamDlg(RenderThingTest *r, IRendParams *ir, BOOL prog) {
  26.     hFont = CreateFont(14,0,0,0,FW_BOLD,0,0,0,0,0,0,0, VARIABLE_PITCH | FF_SWISS, _T(""));
  27.     rend = r;
  28.     this->ir = ir;
  29.     this->prog = prog;
  30.  
  31.     // TODO: Check prog before adding rollup
  32.     hPanel = ir->AddTabRollupPage(
  33.         renderTabClassID,
  34.         hInstance,
  35.         MAKEINTRESOURCE(IDD_PANEL),
  36.         RenderThingTestRendParamDlgProc,
  37.         _T("RenderThing Render"),
  38.         (LPARAM)this);
  39. }
  40.  
  41. RenderThingTestRendParamDlg::~RenderThingTestRendParamDlg() {
  42.     DeleteObject(hFont);
  43.     ir->DeleteRollupPage(hPanel);
  44. }
  45.  
  46. void RenderThingTestRendParamDlg::AcceptParams() {
  47.     // TODO
  48. }
  49.  
  50. void RenderThingTestRendParamDlg::RejectParams() {
  51.     // TODO
  52. }
  53.  
  54. void RenderThingTestRendParamDlg::InitParamDialog(HWND hWnd) {
  55.     // TODO: Initialize controls to what the params indicate
  56. }
  57.  
  58. // Windows callback
  59. static INT_PTR CALLBACK RenderThingTestRendParamDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
  60.     RenderThingTestRendParamDlg *dlg = DLGetWindowLongPtr<RenderThingTestRendParamDlg*>(hWnd);
  61.     switch (msg) {
  62.         case WM_INITDIALOG:
  63.             dlg = (RenderThingTestRendParamDlg*)lParam;
  64.             DLSetWindowLongPtr(hWnd, lParam);
  65.             if (dlg) {
  66.                 // TODO: add check for prog
  67.                 dlg->InitParamDialog(hWnd);
  68.             }
  69.             break;
  70.         case WM_DESTROY:
  71.             break;
  72.         case WM_COMMAND:
  73.             break;
  74.         case WM_LBUTTONDOWN:
  75.         case WM_MOUSEMOVE:
  76.         case WM_LBUTTONUP:
  77.             dlg->ir->RollupMouseMessage(hWnd, msg, wParam, lParam);
  78.             break;
  79.         default:
  80.             return FALSE;
  81.     }  
  82.     return TRUE;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment