Move Vaadin Slider - user-interface

When I am invoking slider.setValue() it changes internal field value but not graphical representation of slider.
How to move slider to given value from server side? (For example on button click or something like this. Value change is invoked from other component.)
I have set slider.setImmediate(true); and after changing value called slider.requestRepaint(); but this did not helped.

You may check its' parent components and also check for the component which invokes this method in its' listener.

Related

How to send values of Numeric Indicator to Numeric controler in LabVIEW

I need to get the showing value from numeric indicator and then put that value to the numeric controller to show in another numerical indicator in LabVIEW.
Normally we can get the values from numerical control to the numerical indicator.I need the opposite of that.
As shown in picture need a method to get values that show in numerical indicator to the controller.
Use a Property Node (Value), it has the error lines, so it is useful for dataflow control.
You can use a local variable or a property node.
Local Variable
Right click on the control or indicator, from the shortcut menu choose:
create->local variable
Once you've created that local variable you can right click on it and change it to write or read local.
Property Node
Right click on the control or indicator, from the shortcut menu choose:
create->property node->value
You can then right click on the property node and choose 'change to write' or 'change to read'.
Property Node vs Local Variable
Either will work in most cases. Local variables will perform better, providing faster access to the value, similar to that of the control/indicator terminal itself. Property nodes do provide error terminals that allow for taking advantage of data flow and ordering your operations. If you already have a property node in use for that control/indicator, adding a value terminal may not impact performance, otherwise use a local, if you need to control order of operations use a flat sequence structure and pass your error cluster through the structure.

IUP customizing/localizing controls

Is it possible to subclass or similar IUP controls to get modification in functionality on lower level so changes can apply to whole project (all instances of controls).
1)
For example, in my locale we don't have decimal point but decimal coma sign on numeric keyboard. It would be ideally that IUP spin accepts coma and point for decimal point.
Can that be done and how?
2)
How to get parallel navigation with keyboard (Up/Down) on IUP dialogs like we have tab/shift+tab.
3)
How to get value on input controls to be selected when get focus?
4)
How to recognize mouse doubleclick on IUP matrix cell?
Sorry for mixed questions but I need those answers now.
Thanks.
Yes, it is possible to subclass. But it is is very low level and requires to download IUP source code. The documentation already includes information about the internal SDK. It is easier to simply create a function, for example myIupLabel() that creates a IupLabel and sets some pre-defined attributes that will be used by the application.
1) As far as I know there is no control of the decimal point in IUP spin. You have to detail more what you are using. If it is the IupSpin control, if it is a IupText control with a SPIN attribute, and if you are using the MASK attribute of a IupText. And Yes, it is possible so solve that problem, but how depends on these details.
2) This is already done for toggles and buttons.
3) You mean IupText controls? Use the GETFOCUS_CB callback and set the SELECTION attribute inside the callback.
4) The double click is used for editing. The EDITION_CB is called when a double click occur. But there is another way. You can set the BUTTON_CB callback since the IupMatrix inhertis from IupCanvas, but you will have to save the previous one and call it from inside yours.

Tooltip only shows when running from source

I have a hierarchical flexgrid control with the ToolTipText property set, and when I run from source the tooltip displays as it should. But when I compile it and run that way, the tooltip doesn't display.
I've tried to remove anything listening to MouseMove in the hopes that that would fix it, and when I add some code to put the tooltip text into a message box, it appears to be set correctly. Can anyone think of why this would be happening?
Update: It appears that the problem arises when I host the grid inside another user control. E.g.: make container.ctl, which is just a blank control but with ControlContainer = True. Then make gridholder.ctl, which is a mshfg inside of a container.ctl. Lastly, embed gridholder.ctl into some form. Tooltips on the flexgrid don't appear to show up.
I'm interested to see how reproducible this is...
I haven't found a workaround for this issue yet, but I have a better idea of why it's happening after some testing and stepping through some of the VB6 runtime code in WinDBG.
The first interesting thing is that VB6 doesn't use the standard tooltip display mechanisms provided by Windows. For example, it doesn't use WM_NOTIFY messages to show/hide tooltips, or any of the other "standard" tooltip support described in the documentation explaining how tooltips work in Windows.
Instead, the VB6 runtime has its own way of managing and displaying tooltips. In principle, it's similar to in some ways to the standard Windows way of dealing with tooltips, but it's also different in a quite a few areas.
A breakdown of how VB6 does tooltips:
When a VB6 program starts, the runtime uses SetWindowsHookEx to install a mouse hook for the program's main thread.
The mouse hook intercepts all mouse messages sent to the program, in particular all WM_MOUSEMOUSE messages
Whenever the mouse hook runs, it calls an internal method in the VB6 runtime to get the object pointer (HCTL) of the control that the mouse is currently over top of. Note that this is an actual COM interface pointer, not a window handle.
It translates the HCTL to the corresponding window handle (HWND).
It checks to see if the mouse position is within that window's rectangle.
If so, it retrieves the ToolTipText property for the control. If this is not empty, it creates a tooltip window and displays the tooltip after a 700ms delay.
The problem with the MSHFlexGrid (and I imagine other controls that are not standard VB6 controls) is that this code doesn't retrieve the correct HCTL when you hover over the control and it's inside a custom container.
In that case, the code retrieves the HCTL of the custom container, not the HCTL of the MSHFlexGrid itself. Therefore, it retrieves the container's ToolTipText property (which is empty) and not the grid's ToolTipText, and therefore won't display a tooltip.
I'm not sure exactly why it does this, because as noted in the comments on your question, all of this works correctly if you use a PictureBox as your container.
I suspect the PictureBox has code to handle this correctly that is not included when you create your own container.
I'll update this answer with an actual workaround if I can find one. The only thing I can think right now is to somehow "sync" your container's ToolTipText property with the grid's ToolTipText property, so that when VB6 requests the container's ToolTipText, it will return the value of the grid's ToolTextTip property instead.
This is easier said than done, however, because ToolTipText is an extender property, and extender properties take precedence over properties that you write yourself that have the same name.
After a bit of research, I found what I think is the underlying problem. Your user control is not implementing any method for the controls to interact with. User Controls that are Container Controls need to implement the Extender functionality. These two links are the best I've found on the subject so far.
http://www.justvb.net/obook/ch7.htm#UsingtheExtenderObject
http://msdn.microsoft.com/en-us/library/aa733622(v=vs.60).aspx

How do I add a Label to a display method in Dynamics AX 2009?

I would think you should be able to define a label on a display method. However, I can't see it in the properties window. But there is a Best Practice Warning:
Control label is a copy of its display method label
So who can either tell me how to add the label or what this error message is really about?
The return type for the display method should be an Extended Data Type. On the EDT you should supply the label.
Each form control must have a label either inherited from EDT/Enum or explicitely set on the control. The label set on the control must not be the same as the EDT/Enum's label. I suppose in your scenario it is the same, and in order to get rid of this BP warning you should just clear the label in the control properties. If you want the label to be different you can change it in the control properties or in the Extended Data Type/Base Enum properties but then it will be changed everywhere througout the system.

NSStepper ignores current NSTextField value

I have the same initial problem as described in Integrate NSStepper with NSTextField:
I need to have a NSTextField working with a NSStepper as being one control so that I can edit an integer value either by changing it directly on the text field or using the stepper up/down arrows.
Using bindings as commented on by carlosb results in a usable UI. However, in the initial question carlosb describes the following:
Problem is that if I edit the text field then click the stepper again it will forget about the value I manually edited and use the stepper's internal value.
This is why I am posting a variation on this question again. carlosb's use of bindings doesn't solve this problem. This happens in both the current project I am working on and a test project I have created. The test project can be found at GitHub. You can download it there (even without git) via the "Download Source" button in the top right.
Is there a clean way to solve this issue?
Text fields and sliders are both in the view layer of the MVC pattern. You'll have much better results by binding both of those views to a property of your controller.
Your problem is that that the editing isn't ended until you press return or the field loses focus (so the number is never actually changed). If you press return or leave the field after editing, you'll see it works as expected.
One solution is to check the "Continuously Updates Value" option in the text field's value binding and check the "Continuous" option in the text field's attributes.
This will make sure the value is being updated as it's typed, so an immediate click on the stepper will reflect these changes.

Resources