cancel
Showing results for 
Search instead for 
Did you mean: 

Blocktyler string0 block auto update ?

Pioneer
Pioneer
Hi, i have a blockstyler with string , i am using string0->GetProperties()->GetString("Value"); in update_cb() to get the value. i have to place this text in drawing without closing the UI. But everytime i have to press enter to reflect the text in drawing. I just want to avoid enter button, whenever i enter text in string0 block, it should reflect in drawing & Ui should be open condition. i am just looking for some functionality as balloon tool used to work in drafting
11 REPLIES

Re: Blocktyler string0 block auto update ?

Siemens Phenom Siemens Phenom
Siemens Phenom

The Block UI Styler does not fire a callback with every character you type in a string field.  As you have discovered, you must either press enter or move the focus to a different dialog item in order to fire the update callback.

 

Re: Blocktyler string0 block auto update ?

Pioneer
Pioneer
Hi, thanks for the reply, focus to a different dialog item ? can you give some example ? I am stuck in this Thanks

Re: Blocktyler string0 block auto update ?

Siemens Phenom Siemens Phenom
Siemens Phenom

When you put the cursor in the string field, we say that the string block has focus.  If you type something into it and press enter, the update callback will be fired, and conditional block for the string inside the update callback will run.

 

If you are typing in the string field, and you use the tab key or the mouse to move the focus to a different item in the dialog, then the same thing will happen.

 

The Block UI Styler does not have any method that will allow you to trigger a callback every time you type in a character in a string field.  The callback fires when you indicate that you are finished entering text, using one of the methods described above.

Re: Blocktyler string0 block auto update ?

Pioneer
Pioneer

There is an open enhancement request to add a "text changed" callback to the BlockUI string block.

 

ER 7724275

Re: Blocktyler string0 block auto update ?

Pioneer
Pioneer
Thanks for the answers!
I will explain what I am looking in detail
I have a UI more like balloon tool in drafting.
With enum0 having some custom symbols, 2nd input is the string0 block, 3rd is the cursorlocation0.
I can place symbols on ok_cb, apply_cb.
I want to place symbols while clicking cursorlocation0, enum0 seems to be working fine only in case of string0 I have to press enter to reflct values in symbol.

Re: Blocktyler string0 block auto update ?

Siemens Phenom Siemens Phenom
Siemens Phenom

Correct - I submitted that for a customer in May of this year.  I looked it up, and development has not made a comittment one way or the other on that yet.

 

Re: Blocktyler string0 block auto update ?

Pioneer
Pioneer
Thanks alot Steve!
I was trying whole day, doing some hit & trials & was unsuccessful.

Re: Blocktyler string0 block auto update ?

Pioneer
Pioneer
One more thing, In case of enum, while pressing apply button enum resets the value. How this can be overcome ? THanks

Re: Blocktyler string0 block auto update ?

Phenom
Phenom

When you click Apply the dialog is basically closed and reopened, so to keep the values you had you need to set them in the initialize() or dialog_shown() callbacks (or whatever they are called Man Frustrated).

So you need to have a variable in your code to keep the current value of the enum, then use that to set the enum value as the dialog is redisplayed.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5