Exemple #1
0
void Splitter::create(const Seed& cs) {
	pos = cs.pos;
	horizontal = cs.horizontal;
	BaseType::create(cs);

	theme.load(VSCLASS_WINDOW, this);
	onPainting([this](PaintCanvas& canvas) { handlePainting(canvas); });

	onLeftMouseDown([this](const MouseEvent& mouseEvent) { return handleLButtonDown(mouseEvent); });
	onMouseMove([this](const MouseEvent& mouseEvent) { return handleMouseMove(mouseEvent); });
	onLeftMouseUp([this](const MouseEvent&) { return handleLButtonUp(); });

	auto tip = WidgetCreator<ToolTip>::create(this, ToolTip::Seed());
	tip->setText(Texts::get(Texts::resize));
	onDestroy([tip] { tip->close(); });
}
Exemple #2
0
BOOL CALLBACK DrawDlgProc (HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam) 
{

  	switch (iMessage)
  	{
    		case WM_INITDIALOG:
	      		handleInit(hDlg);
      break;

	  	  case WM_COMMAND:
         return(handleWMCommand(hDlg, lParam, wParam));
 	  		break;

    		case WM_LBUTTONDOWN:
         handleLButtonDown(hDlg, lParam);
 		  	break;

	    	case WM_MOUSEMOVE:
         handleMouseMove(hDlg, lParam, wParam);
   			break;

   		 case WM_LBUTTONUP:
         handleLButtonUp(hDlg, lParam);
	   		break;

     /* As usual, add a destroy handler if this gets long */
      case WM_DESTROY:
        /* Put a message box here to test this out */
         //MessageBox(hDlg, "WM Destroy test", "WM_DESTROY", MB_OK); 
        /* Then free up all allocated memory. */
         freePointList();
         freeJointList();
      break;

     /* Probably should free some memory, etc. before 
      * shutting down.
      */
    		default:
	   		return FALSE;
   }
	  return TRUE;

  	ReleaseDC(hDlg, hdc);
  	ReleaseDC(GetDlgItem(hDlg,IDC_DRAWSPACE), hdc);

} /* close DrawDlgProc() */