When use acedGetDist, how can I check if User input value by keyboard or by points? - autocad-plugin

When we ask User to select distance by acedGetDist User can input value by keyboard like '4.0' , or click pair or points.
Everything is OK, as long as User draws in scale 1:1. but when User want to draw in other scale distance given by points will be the same, but if User input value I need to recalculate it. How can I check how User input value?
First I tried to check system variable "lastpoint" but it is not updated when pick points in acedGetDist. I use ZWCAD (maybe that's why it's not updated)
Any ideas how to check how User input value?

Related

when i try to enter decimal numbers like 0.5 infields given it is instantly changing to .5 in oracle forms

If I enter values as 0.5 the zero before . is getting removed and displayed as .5 this is happening when i move to other field. is there any settings need to be done plz help
Open item's Property Palette and set Format mask to desired value. For example:
If you don't want the .0 when the value ends with .0, I suspect you should be able to change the item's format mask programmatically based on the value. I haven't tested doing something like this but I believe it would work. Depending on how you designed your and and the flow as you go through it, the awkward part may be deciding which triggers to use to set the mask then reset the mask.
SET_ITEM_PROPERTY ('TEXT_ITEM1', FORMAT_MASK, < desired mask >)
The above would not work if the item is part of a multi-record block.

Eclipse generate many JFormattedTextField

I implemented Gauss Jordan Algorithm in eclipse and now I am trying to make it be a software, however I have no experience at all with GUI.
I have a window that asks for input of 2 things number of variables and number of equations and when user enters the numbers and presses submit button, second window opens.
In that second window I need certain number of textfields to appear itself, which will be dependent on the two variables mentioned above.
My question is there any way to grab the value from first class(first window where user entered variables which I stores in first class) pass it to second one(second window where the textfields will appear) to tell it how many rows and columns should be generated with textfields and then the program would generate it?
I tried looking up on youtube, because I do not understand documentations well, so any answer would be very appreciated!
Well the MVC pattern could help you to do this, check something like this:
http://www.austintek.com/mvc/

How do I post-process a control’s input, and update all attendant controls?

I’m working on a little optical-illusion app. As part of that, I have a model key (a CGFloat) representing an angle.
I have three controls — an NSTextField, an NSStepper, and an NSSlider — each bound to that model key. (The NSTextField was created as a “Text Field with Number Formatter”.)
I want that angle to fall between -45 and 45 degrees at all times. I also want it rounded to the nearest integer.
To that end, I’ve implemented a setAngle method that applies those rules. In addition to rounding its input, it replaces any value falling outside the acceptable range with the closest valid value.
I notice that whenever I use one of the controls to change the angle’s value, the other two controls reflect the post-processing value — but the submitter itself does not.
For instance, if I move the slider, the text field shows the rounded value, not the possibly-fractional value that the slider submitted.
Likewise, if I enter 44.5 in the text field, the slider’s position corresponds to 45.
However, the submitting control still displays the “raw” value it submitted: the text field in the last example continues to read 44.5.
Placing
[self willChangeValueForKey:#"angle"];
and
[self didChangeValueForKey:#"angle"];
around the code in setAngle that actually changes the value had no effect on this.
My principal questions, then, are these:
Is there, generally speaking, a “correct” way to alter a value submitted by a control, such that all controls bound to the key get the updated value? I'm not entirely sure that angleSet is the right place to pull the sort of post-processing shenanigans I am, but I'm even less sure where else I should do so. (The Apple docs regarding validation in key-value coding expressly discourage using validation to this end.)
If there's no general-purpose mechanism for setting a tweaked version of model key, and notifying all associated controls after the fact, is there a way to identify the single control doing the actual setting, and update it with the post-processed value?
Thanks in advance!
use cocoa binding is the most easiest way for this situation.
declare a property
#property CGFloat angle;
and bind it to value of the controls with keypath angle or someobject.angle (it depends on your implementation)

Any way to trigger a callback function while hovering over a point in Matlab?

I am using a while loop and within that I add ginput in MATLAB to capture the positions of mouse. I check every time if the returned position is within some area so I will plot some curve on the current figure. But the problem is, by using ginput, I have to press enter before the positions are returned. Is that any way to capture the mouse event such that when the current cursor hover over some points, a callback function will be triggered? Thanks.
Since you already have a figure you're using, you could set the listening property for the figure:
set(gcf,'WindowButtonMotionFcn', #mouseMoveListener);
But now you have to create a function called 'mouseMoveListener' (if you want to name it something else, change the words after the # sign to whatever name you want, and make sure the actual event function is named that too).
Within your function mouseMoveListener you can now get the mouse coordinates:
MousePos = get(mainAxis,'CurrentPoint');
Which tells the current point of the mouse with respect to the axes coordinates. From there, you can have whatever if statement check that the position is where you want it and perform whatever tasks you want based on that information.

replicating mouse motion using ajax

I want to implement an application on my website where once the users are connected, they share a text editor. If one user enters anything on
the text editor available on his screen, the same text appears on the second user’s
screen at the same coordinates.
Same thing goes for the other user. Also there would be pointer shaped images on both user’s screens to represent mouse pointers.
When user A moves his mouse pointer, the image on user B’s screen should be
moved according to the movement of user A’s mouse and similarly, when user B
moves his mouse, the image on user A’s screen should be moved accordingly.
The problem is I am using database to store the coordinates of each user. And this approach results in the a lot of lag and delay. What should I use in place of the database?? Please Help !
You probably don't want to request the updates but push them to your clients: http://en.wikipedia.org/wiki/Comet_%28programming%29 . This reduces the delay between an update from your client to the server and other clients again checking for updates.
how abt using Redis : http://code.google.com/p/redis/
an example of a similar collaborative text editor using this : http://www.web2media.net/laktek/2010/05/25/real-time-collaborative-editing-with-websockets-node-js-redis/

Resources