LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

text box causes program to halt

CVI 6 (runTime 8.0) program has a Text Box with a vertical scroll bar. If the user scrolls back in the text box the program halts.
The program will only continue running if the scroll bar is returned to end of text window by the user.
 
other than removing the scroll bar how can the program do something to kick the user out of the text box.
 
Thanks.
 
- Make Software User Friendly -
0 Kudos
Message 1 of 10
(4,304 Views)
Hi rorOttawa,
 
Can you attach an example?  Why do you want to kick the user out of the text box?  How does that relate to the program continuing when the user scrolls to the end of the text box?
 
Are you saying that your first paragraph seems to be a bug?  Does it matter if you use the keyboard or the mouse to scroll the text box? 
Cheers,

David Goldberg
National Instruments
Software R&D
0 Kudos
Message 2 of 10
(4,282 Views)
Demo attached.
 
Bug ?
Annoying Yes
 
Thanks.
 
- Make Software User Friendly -
0 Kudos
Message 3 of 10
(4,263 Views)
Hi rorOttawa,
I noticed in your demo that the selection event on the textbox remains somewhat "pending", i.e. when you click and drag with the mouse, the highlighting  function remains enabled so that moving the mouse the highlighted part changes accordingly; this is the only way I had to stop your program up to a second click on the textbox that "commits" highlighting function; in every other condition the program remains active and logs to the textbox and the file.
It seems to me that this is not standard textbox behaviour: are you intercepting mouse events on the textbox to improve highlighting facilities on the control? And moreover: since this control is so frequently updated during test, it's really necessary let the operator interact with it?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 10
(4,247 Views)
no I am doing anything about mouse selecting in the text box. I think it is the result of the text box having a "hot" property.
I do not want to select text in the box ever.
No it is not necessary to have the operator able to scroll back but it is convenient and I have been thinking about removing the scroll bar
but I am buzzled as to why it is doing it.
I should be able to control what is going on in the text box but I have not found the secret yet .
 
Based on what you say, maybe you can select text in any "hot" text control and halt the program.
all the "white" boxes are "hot"
They do not need to be hot but when you select "indicator" instead of 'hot" property they go grey instead of white.
 
thanks for your input.
 
I will look at changing the text box "hot" property yet again.
 
 
- Make Software User Friendly -
0 Kudos
Message 5 of 10
(4,232 Views)


@rorOttawa wrote:
They do not need to be hot but when you select "indicator" instead of 'hot" property they go grey instead of white.



You can always paint them in white again after changing them to indicator Smiley Wink


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 6 of 10
(4,224 Views)


@rorOttawa wrote:
Based on what you say, maybe you can select text in any "hot" text control and halt the program.
all the "white" boxes are "hot"


Tested right now. Yes, you're right:every text selection in whichever text box freezes the program.

I may suppose that this depend on the fast update of your GUI: the user is not able to terminate text selection before the focus is moved by the program to another control, so that text selection event remains somewhat "pending" (infact, you may notice that moving the mouse over the control you are selecting text on actually changes the selection even if no mouse button is pressed).

As far as I can experiment from here, changing control modes to indicator (and applying the desired make up before starting the actual test) should solve your problem.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 7 of 10
(4,216 Views)

I made a mistake. The text box is already an "indicator". It is NOT "hot"

So now the question is know to prevent text from being selected in a text box ?

 

- Make Software User Friendly -
0 Kudos
Message 8 of 10
(4,195 Views)


@rorOttawa wrote:

So now the question is know to prevent text from being selected in a text box ?



Something like this function:
 
int CVICALLBACK RejectFocus (int panel, int control, int event,
  void *callbackData, int eventData1, int eventData2)
{
 switch (event) {
  case EVENT_COMMIT:
  case EVENT_RIGHT_CLICK:
  case EVENT_LEFT_CLICK:
   return 1;
  default:
   break;
 }
 return 0;
}
You may need to add EVENT_LEFT_DOUBLE_CLICK and EVENT_RIGHT_DOUBLE_CLICK as well.

Message Edited by Roberto Bozzolo on 05-24-2007 06:39 AM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 9 of 10
(4,166 Views)

Thanks for pointing me in the right area. I think I have the fix or one fix. I think your fix would have worked also.

I removed the callback for the mainpanel. I did not really need it anyway.The result is that you can not kill the window with the X at top right.The shut down should be via the buttons on the GUI anyway.

Here is new demo with the fix.

See if you can lock it up.

Again thanks for your input.

 

 

- Make Software User Friendly -
0 Kudos
Message 10 of 10
(4,138 Views)