
Quote from Sinesi Giuseppe on March 15, 2021, 1:49 amClicking a button with a text saved in a variable I would like to write it in a selected text entry. who helps me?
Clicking a button with a text saved in a variable I would like to write it in a selected text entry. who helps me?
Quote from Gaev on March 15, 2021, 4:10 pm@sinesi-giuseppe
Say, you have previously populated variable [sometext] like so ...
SetVar "[someText]" "VisualNEOWin"Assuming that the Variable: (to store TextEntry contents) for TextEntry15 is defined as [TextEntry15], in order to populate this box ...
SetVar "[TextEntry15]" "[someText]"
Say, you have previously populated variable [sometext] like so ...
SetVar "[someText]" "VisualNEOWin"
Assuming that the Variable: (to store TextEntry contents) for TextEntry15 is defined as [TextEntry15], in order to populate this box ...
SetVar "[TextEntry15]" "[someText]"
Quote from Gigi on March 16, 2021, 10:52 pmthat's not what I was asking, I have many tex entries, when I select them with the mouse I wanted that by pressing some buttons these automatically inserted texts
that's not what I was asking, I have many tex entries, when I select them with the mouse I wanted that by pressing some buttons these automatically inserted texts
Quote from Gaev on March 17, 2021, 2:02 am@gigi
Sorry, I don't understand; something is getting lost in translation.
1) when you say many tex entries, are you referring to entries in a ListBox ?
2) when you say automatically inserted texts, do you want the selected ListBox entry to be inserted in a Text (or TextEntry) object ? ... if TextEntry object, where do you want it to be inserted ? (beginning, end or at current insertion point ?)
Perhaps you can elaborate with a screenshot and some arrows and text ? ... or post a simple pub file with notes about what you wish to happen.
Sorry, I don't understand; something is getting lost in translation.
1) when you say many tex entries, are you referring to entries in a ListBox ?
2) when you say automatically inserted texts, do you want the selected ListBox entry to be inserted in a Text (or TextEntry) object ? ... if TextEntry object, where do you want it to be inserted ? (beginning, end or at current insertion point ?)
Perhaps you can elaborate with a screenshot and some arrows and text ? ... or post a simple pub file with notes about what you wish to happen.

Quote from Sinesi Giuseppe on March 17, 2021, 8:06 amthis is example. Thank
this is example. Thank
Uploaded files:Quote from Gaev on March 17, 2021, 6:21 pm@sinesi-giuseppe
Thank you for the pub that explains your requirement.
I have a solution ... but before I post it here, can you advise ...
a) when you say when I select the text entry and click the button it will insert the (chosen) text inside the text entry, is the chosen text "Hello" or "House"(depending on which button is clicked ? ... or something else ?
b) I notice that each of your TextEntry boxes (CasellaImmissioneTesto1, CasellaImmissioneTesto2, CasellaImmissioneTesto3 and CasellaImmissioneTesto4) specify the same value (i.e. [CasellaImmissioneTesto1]) for Variable: (to store TextEntry contents) ... I am assuming this is just an error (you probably created the other 3 boxes by Duplicating the first one ... if all boxes have the same associated variable, when you populate this variable with a value, it will show up in all 4 TextEntry boxes ... please confirm that each box should have a different associated variable.
Thank you for the pub that explains your requirement.
I have a solution ... but before I post it here, can you advise ...
a) when you say when I select the text entry and click the button it will insert the (chosen) text inside the text entry, is the chosen text "Hello" or "House"(depending on which button is clicked ? ... or something else ?
b) I notice that each of your TextEntry boxes (CasellaImmissioneTesto1, CasellaImmissioneTesto2, CasellaImmissioneTesto3 and CasellaImmissioneTesto4) specify the same value (i.e. [CasellaImmissioneTesto1]) for Variable: (to store TextEntry contents) ... I am assuming this is just an error (you probably created the other 3 boxes by Duplicating the first one ... if all boxes have the same associated variable, when you populate this variable with a value, it will show up in all 4 TextEntry boxes ... please confirm that each box should have a different associated variable.
Quote from mishem on March 17, 2021, 7:02 pm@gaev
I have a solution ...
Exactly. There is also an opportunity to get the selected text.
GetObjectInfo "" "SelectedText" ""
:)
I have a solution ...
Exactly. There is also an opportunity to get the selected text.
GetObjectInfo "" "SelectedText" ""
:)
Quote from Gaev on March 17, 2021, 7:45 pm@mishem
Exactly. There is also an opportunity to get the selected text.
GetObjectInfo "" "SelectedText" ""What I am unclear about is when @sinesi-giuseppe says "chosen text" ... where is this chosen text ? ...
a) if it is in a variable or it is the label of the button, the solution is simple
b) if it is the content of a Text Box, it is still possible
c) if it is a (selected) part of a Text Box, it may not be possible ... according to the help file for GetObjectInfo ... SelectedText can be used to copy highlighted from Text Entry or Article objects ... NOT Text Boxes
Exactly. There is also an opportunity to get the selected text.
GetObjectInfo "" "SelectedText" ""
What I am unclear about is when @sinesi-giuseppe says "chosen text" ... where is this chosen text ? ...
a) if it is in a variable or it is the label of the button, the solution is simple
b) if it is the content of a Text Box, it is still possible
c) if it is a (selected) part of a Text Box, it may not be possible ... according to the help file for GetObjectInfo ... SelectedText can be used to copy highlighted from Text Entry or Article objects ... NOT Text Boxes

Quote from Sinesi Giuseppe on March 17, 2021, 10:46 pmexcuse me, let me explain better, selecting with the mouse and clicking on the textentry 1 box I have the cursor flashing, clicking on button 1 I would like to assign them a text to paste in the selected text entry......
excuse me, let me explain better, selecting with the mouse and clicking on the textentry 1 box I have the cursor flashing, clicking on button 1 I would like to assign them a text to paste in the selected text entry......
Uploaded files:Quote from mishem on March 17, 2021, 11:22 pm@gaev
What I am unclear about is when
I don't understand him either. :)
@sinesi-giuseppe
It is necessary? Or something different?
What I am unclear about is when
I don't understand him either. :)
It is necessary? Or something different?
Uploaded files:
Quote from Gaev on March 18, 2021, 12:34 am@sinesi-giuseppe
let me explain better, selecting with the mouse and clicking on the textentry 1 box I have the cursor flashing, clicking on button 1 I would like to assign them a text to paste in the selected text entry......
The solution (textentry2.pub) posted by @mishem appears to be what I understand you wanted.
Please note ...
a) the key is this code in the GainFocus event section of each of the TextEntry Boxes
SetVar "[Focus]" "[Self]"b) instead of having one Button for each piece of text (with hard-coded values in each Button), you might consider using a single ListBox (with each entry representing some text) ... then, the user can just select the required entry ... the values of each entry can be hard coded at design time or dynamically loaded at run time from (say) a text file.
let me explain better, selecting with the mouse and clicking on the textentry 1 box I have the cursor flashing, clicking on button 1 I would like to assign them a text to paste in the selected text entry......
The solution (textentry2.pub) posted by @mishem appears to be what I understand you wanted.
Please note ...
a) the key is this code in the GainFocus event section of each of the TextEntry Boxes
SetVar "[Focus]" "[Self]"
b) instead of having one Button for each piece of text (with hard-coded values in each Button), you might consider using a single ListBox (with each entry representing some text) ... then, the user can just select the required entry ... the values of each entry can be hard coded at design time or dynamically loaded at run time from (say) a text file.

Quote from Sinesi Giuseppe on March 20, 2021, 9:28 amNot exactly what I was looking for but a great starting point for my work. Thank you all
Not exactly what I was looking for but a great starting point for my work. Thank you all