How to batch-rename the labels of existing labview controls? - rename

Let's say I have a front panel with 100 buttons named "Button 1"..."Button 100". How can I quickly rename all of them to "Push Button 1"..."Push Button 100"?

Same answer as Dave_St but as vi snippet.
Before running the VI:
And After running the VI:

It can be done programmatically but the vi whose control names are to be changed must not be running in any way (it can be loaded into memory but the run button must be flat white).
Get all the front panel references from the vi. Then change their names with another vi using the Label.Text property.

That is a really good question, if you can't just get rid of them and make a new button called "Push Button 1" that you use to create all the others. I'm assuming they're already implemented enough to make that difficult. I can't test it out on the machine I'm at, but I'd create a new VI and open a reference to the VI with your buttons in it. Then you can get the references to all the front panel controls, which you can then run through a loop that checks if it's a button and then changes the label.

Related

How to change the functionality of a button so that it can work as the backspace button

Okay, so I have a Compaq laptop [American keyboard].
It is a few days that the backspace button is broken - I mean, it is totally popped off. It ought to be replaced but it is hard to find it out.
Now, I was wondering whether or not there was a way to change the functionality of another button so that it can replace the functionality of the backspace button.
It is not the DEL button. It is the BACKSPACE button [above the Enter button].
I knew that through some binary numbers it is possible to change the functionality of a button. For example, I can change the DEL button in the Number Lock so that instead of working as DEL button or dot, it will work as backspace.
Is it possible?
Another way on Ankit's recommendation:
After installing the AutoHotkey, creating the short script and saving it with .ahk extension, just put the file in the startup folder :) click Start(or windows logo)---All Program---startup folder :) then re-start pc.
If on windows, you may use AutoHotkey, install it, create a file with .ahk extension and put following code in it.
F1::Send {BackSpace} ; Makes the 'F1' key send 'BackSpace' key.
Then run the above script on startup.
More Details for remapping here.

How to select text with mouse scrolling in vim?

Sometimes I want to copy some content on remote host in vim, which will last for more than 1 page. But when clicked by left-click of mouse, and scrolling down, I find I was stuck at the first page.
I know I can use scp or first cat file then select.
But is there a way to enable mouse scrolling to do such a selection in vim?
First, I'd avoid the problem entirely. Start a selection using v before you start scrolling. Then the start of the selection stays put and only the end of the selection moves as you scroll. Then make sure to Shift+click instead of just clicking to set the end position.
But if you really want to be able to scroll with the mouse while holding the button to select text, check your 'mouse' option to make sure it contains "a" or "v". It sounds like you may be using a "modeless selection" (:help gui-mouse-modeless) by mistake. A modeless selection only allows you to select text currently on the screen (it does not scroll), but it also lets you select non-text like line numbers.
Also check that you don't have any mappings defined for the scroll events documented in :help scroll-mouse-wheel. For me this feature "just works" in Windows gvim, so I'm not sure what would cause it to not work for you. But I had to try it out so see, since I almost never do that anyway.
If you are connecting from a system with an X11 server, use ssh -X to enable X11 forwarding. This will allow you to connect to the clipboard of your local machine from the remote vim.
For more information on how to use the X11 clipboard check vim's help for x11-selection.

Linux - Any way to configure or create a script/program to make right click not select menu item?

The default behavior for right-clicking on most recent Linux distros is to select a menu item in a right-click menu upon releasing the right mouse button. While this saves some mouse presses, it is driving some of my Windows-trained (and rather vocal) coworkers completely bonkers, and a lot of searching has told me that there is no option to change this behavior in the distros they are using (mostly RHEL 6).
To make my work environment a little less volatile I would like to try to program a fix or patch for their systems to make right clicking work like they are used to (the menu does not even appear until the right mouse button is released), but I don't know what kinds of tutorials I should be looking for (shell scripts? C? etc.) in order to do this.
If I could be pointed in the right direction that would be lovely! (or if someone by chance already knows of a fix, that would work too, though a lot of Googling has told me that there does not appear to be one currently)
Follow the directions here:
https://unix.stackexchange.com/questions/20550/how-to-disable-the-forward-back-buttons-on-my-mouse
But instead of disabling the forward and back buttons, disable the right click mouse button. You can easily dump the resulting command into a shell script which calls xmodmap. Then you can make icons that disable and enable the right mouse button, for the times where they will need it.

Button-Triggered Insert File Only Works If Portal Contains Edit Box for Container Field

I'm working with a FileMaker Pro 11 database that contains a portal. I've added an "attach file" button to the portal which triggers a simple "Insert File[portal_table::attachment_field]" script. When I click on the button, I would expect an insert file dialog box to appear. Instead, nothing happens.
If I add a text box to the portal, setting the text box's field to portal_table::attachment_field, the attach button starts working.
Why am I required to add this text box to the portal in order for my button-triggered script to work? Is there a way I can modify my script so that it works without requiring the text box's presence?
Thank you,
Ben
Generally speaking FileMaker's "Insert..." commands behave as if a user has done an action manually (activating script triggers, selecting the field, etc.) including the requirement that the field actually be displayed on the screen.
Unfortunately, as far as I am aware, there is not a way to use "Set Field" to specify a file to be added to a container field. One possible work-around is the following:
Freeze Window
Set Variable [$RecordIndex to RelatedTable::Index]
Go to Layout [A Layout of RelatedTable specifically for inserting files]
Enter Find Mode
Set Field [Index to $RecordIndex]
Perform Find
Insert File
Go to Layout [Original Layout]
Alternately, it may be easier to just include the field on the layout at a very small size (1 pixel x 1 pixel).

Notepad++ tab color

Is there a way to change the color of a tab (in the tab bar) according to the path of the file?
I tried with the PythonScript plugin, but couldn't find a method to change the color of a tab.
I need this because I edit scripts from two environments at the same time, from a LIVE environment, and from a development environment, and I need to be extra careful when editing a LIVE file.
I was looking for a programmatic way to change the color of the tabs, and reviewed the online documentation of Notepad++ but did not find anything about it. So, instead, I propose the following method for your case, it could be helpful to always know which of your files are from the development environment and which from the live environment:
Open a blank instance of Notepad++:
Now start a macro recording: Press Start Recording button on Notepad++ toolbar:
Open a new document
Now you'll have two open blank tabs.
Right click newly open tab and click in option Move to other view from contextual menu
You'll have a window splitted vertically and your two tabs will be displayed next to each other. You'll use these two tabs as separated "containers" for your files
Press Stop Recording button:
Save your just recorded macro:
assign a keyboard shortcut:
Now you can run that recorded macro (from Macro menu, or invoking keyboard shortcut you assigned), every time you want to work on your two environments.
(Optional) Right click vertical separator between "containers" and click Rotate to right
Now your "containers" will be split horizontally and will be displayed one above the other. Personally, I'd recommend you this layout.
Click on the tab at first "container" and from there, open all your "dev" environment files; and analogously open all your "live" environment files from second "container". Note that currently selected container has a more intensely coloured active tab.
If you notice that your working space is small, drag the separator to increase your current "container" size, but I recommend you not to take it completely towards the end, because it will make difficult to differentiate which of the two "containers" you are working on.
Note: If you, mistakenly opened a file of an environment from the wrong "container" you'll always be able to fix that by dragging the tab and dropping it to the other "container":
So you'll always keep control of what files must be on each container.
That's it. I hope this info will be helpful for you.
About changing the color of the tab (not folder specific).
Notepad++ has a file called stylers.xml, located in the roaming folder or in the program folder. It also depends in the installation & windows version. If it does not exists then it is self generated.
At the very end of the file, it says
<WidgetStyle name="Inactive tabs" styleID="0" fgColor="xxxxx" bgColor="xxxxxx" />
And here it is possible to change the color of the inactive tab.
However, it does not work, it is a bug that has been "fixed" countless of times in the past. To the date, the current version 6.2.3 UNICODE, changing the values does nothing.
So far, editing the stylers.xml:
6.2.3 = does nothing
design guideline, gray + gray = not good.
6.2.0 = does nothing
6.1.8 = works.
Nice contrast
6.1 = works.
5.9.8 = works.
5.7 = edit works.
ps: sadly,it is not possible to change the fonts of the tabs.
Wanted to add this as a comment, the button's not there.
You can solve your actual problem by using multiple instances of notepad++, refer this. You can save different sessions and optionally use the "Open File In Solution (OFIS)" plug-in.
I've if you've picked a different Style like 'Black Board', then you will have to change these setting in it's .XML in '/themes', and these setting are found at the bottom of the file.

Resources