Hey guys, I need your thoughts on how alternate coordinate systems (units, percentage) should be implemented into NSISDialogDesigner.
Suppose we place a button on an empty dialog and consider only its location (the same ideas applies to size).
Button location can be changed in 3 ways:
- dragging the control with mouse (property grid Location property updates accordingly)
- changing X and Y values of Location property (button moves accordingly)
- using cursor keys (the button moves by 10 pixels each key press and again property grid Location property updates accordingly)
Now the doubts that stopped me from completing this feature.
I'm going to have an IDE where each property coordinate system can be unrelated to others.
I mean a control could have its X in pixels, Y in DU, Width and Height in percentage. NSIS supports definitions like this.
.NET (that's what I used to write NSDD) doesn't, it understands pixels only (and it has its own way to manage different DPIs, but always in pixels).
So I customized Location and Size properties, allowing user to enter strings and not only numbers (like NSIS):
- 120 means "pixels"
- 3u means "units"
- 12% means... "12%"
User entered value (string) is written to NSIS script, while corresponding pixel value is written to .nsddef file.
So far so good, now what if the user drag/resizes the control using the mouse?
Actually I convert pixels-->"user selected unit" and store this one into property, but this leads to not-integer values, like 1.4523213. To have "human" values the user must enter them manually, and I should cut out decimals to avoid loops.
The first solution that comes to my mind is: coordinates that aren't pixel will be locked.
I mean, if I set W=4u, then control width will not be changeable by mouse but only inserting a value into property grid.
I'd like to hear your thoughts...