Project:
Creating movable, re-sizable objects that are defined and displayed using data in an external file that will also record changes in those objects.
Information:
An XML file that contains information (size and position..x y cx cy) about rectangles (A B C D).
Rectangles "snap" to a grid that is 25x25.
Rectangles can only be sized in increments of 25.
Rectangles cannot overlap.
Rectangles contain editable text that will be displayed in the top left corner of the rectangle.
New rectangles can be created and defined.
Existing rectangles can be moved and edited.
Changes will be updated in XML file immediately (AutoSave)
A right click menu on rectangle with options to delete, copy, edit the rectangle. (on Edit menu selection Edit Dialog to define the x y cx cy and text of the rectangle will be called. Data in Edit Dialog updates data in XML file and rectangle displays changes immediatley.)
I'm pretty sure all this can be done. Just look at the Dialog Editor for QM. Pretty much what I am defining here.
I'll be working on this over the next couple days, any help or ideas would be totally rad! Especially a point to get started at.
ret ;messages sel message ,caseWM_INITDIALOG ,caseWM_DESTROY ,caseWM_COMMANDgoto messages2 , ,caseWM_SETCURSOR;;use it to detect left button down. Don't use WM_LBUTTONDOWN because it is sent to the control, not to the dialog. ,sel lParam>>16;;mouse message ,,caseWM_LBUTTONDOWN;;left down ,,selGetDlgCtrlID(wParam);;control id ,,,case3;;edit control ,,,int m=GetMod ,,,sel m ,,,,case [1,2] ;;Shift or Ctrl ,,,,PostMessage hDlg WM_APP wParam m ;;don't use loop on WM_SETCURSOR. Do it async. ,,,,retDT_Ret(hDlg 1) , ,caseWM_APP ,MoveSizeControlLoop hDlg wParam lParam 1 ret ;messages2 sel wParam ,caseIDOK ,caseIDCANCEL ret1
;/ function hDlg hctrl action mouseButton ;;action: 1 move, 2 resize. mouseButton: 1 left, 2 right
MSG m;int mb;
RECT r;GetWindowRect hctrl &r sel action ,case1 ,POINT po;xm po; po.x-r.left; po.y-r.top ;;get mouse offset in control ,case2 ,mou r.right r.bottom ;;move mouse to right-bottom
in XML_Data_Position x y
x and y are mouse coordinates in hDlg. That is, you save mouse coordinates, not control coordinates. Control coordinates are retrieved by GetWinXY.
Totally rad...this would make a good quick note board...
I like how you made the XML update when the mouse is released. I was going to work on that next...but you beat me to it
Holy cow...looking at this thing more...I'm going to have to spend the next week breaking the code down. I'm sure I'll have a lot of small little questions...like for example, I have no clue what this is doing: for(idctrl 1001000000)if(!id(idctrl hwnd))break