It is currently April 19th, 2024, 2:49 am

UserInput Default value not working

Get help with creating, editing & fixing problems with skins
User avatar
DanDaBear
Posts: 110
Joined: February 23rd, 2018, 3:12 am
Location: United States

UserInput Default value not working

Post by DanDaBear »

Hi, I am working on a Settings skin for my text launchers. I have it mostly done but I want the default value of UserInput to show what is currently in the variable for the apps location so it can be edited. They look like this:

Progs4App=["%ProgramFiles(x86)%\Notepad++\notepad++.exe"]

I also have a String meter to show the variable before user clicks to open UserInput and that works fine. (see image below)

Settings1.png
All that shows in the UserInput box is a bracket.

I've tried magic quotes, single quotes and double quotes and nothing works!

I think it's the brackets causing the problem but without them, even though it
shows in the default value of UserInput the apps won't run!
You do not have the required permissions to view the files attached to this post.
Never underestimate the power of stupid! :D
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: UserInput Default value not working

Post by balala »

Could you please post the code you have so far?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: UserInput Default value not working

Post by eclectic-tech »

Seeing the code will help...

If the height of your input measure is not large enough, your default value will be there, but not show in the input box.
Try increasing the height of the input measure or reducing the font size used in that measure until the default value is visible.
User avatar
DanDaBear
Posts: 110
Joined: February 23rd, 2018, 3:12 am
Location: United States

Re: UserInput Default value not working

Post by DanDaBear »

Hi Balala and eclectic-tech,

The Height is not the problem nor the width, as the first app, Progs1App, works fine (Notepad has no quotes or brackets) and all the
text labels come up fine in UserInput box. If you look at the image, you can see that in Progs2App, the first bracket shows with UserInput but nothing more. (I did increase both height and width to be sure)

The same variables show fine in the Text meter, which is what is showing before clicking with mouse, just not in UserInput.

I have attached the entire thing as an .rmskin, as there are Include files for variables and stuff.
I am using the latest Rainmeter, Rainmeter 4.3.0.3298 (64-bit) (see version info in spoiler)
Language: English (1033)
Build time: 2019-03-18 11:00:34
Commit Hash: 3593c281
Windows 10 Home 1803 64-bit (build 17134) - English (1033)
Path: E:\Rainmeter\
SkinPath: C:\Users\dantm\Documents\Rainmeter\Skins\
SettingsPath: C:\Users\dantm\AppData\Roaming\Rainmeter\
IniFile: C:\Users\dantm\AppData\Roaming\Rainmeter\Rainmeter.ini
Thank you for your time and effort.
InfoLaunchBar_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
Never underestimate the power of stupid! :D
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: UserInput Default value not working

Post by eclectic-tech »

Remove all of the brackets and quotation marks from the variable values in the included file 'ProgrammingHVars.inc'.
You do not need to have anything but the complete path to the program executable and the desired name.
Example:

Code: Select all

Progs3App=E:\SteamLibrary\steamapps\common\GameMaker Studio 2 Desktop\GameMakerStudio.exe
Progs3Name=Gamemaker Studio 2
With the brackets/quotes removed, I can see all of the default values for apps and names in the settings skin before and after clicking to modify.

You need to change the LeftMouseUpAction in [ProgsStyle] section in the 'ProgrammingH.inc' file to properly launch the current clicked app:

Code: Select all

LeftMouseUpAction=["[#[#CURRENTSECTION]App]"][!HideMeterGroup Progs][!ZPos "0"][!UpdateMeter *][!Redraw]
If you have the correct paths to the executables, your apps should launch; tested with Notepad, Notepad++.exe, and SciTE.exe variables and all of them displayed and launched when clicked.

After entering a new app path in the 'ProgSettings.ini' skin, I am getting a Win10 query to select a program to open the inputted app... this may be due to having the same mouse actions on both the string and background for the input.
Not sure how to avoid this, I just ignore the Win10 request. :???:
User avatar
DanDaBear
Posts: 110
Joined: February 23rd, 2018, 3:12 am
Location: United States

Re: UserInput Default value not working

Post by DanDaBear »

Thank you SO much, eclectic-tech! It works! :thumbup:

I have been tearing my hair out to get this to work, and as usual it was something simple.
Now I just have to fix the other seven menu include files!

I am getting a Win10 query to select a program to open the inputted app...

Yeah, I'll have to work on that. I'll remove the mouse actions from all but one thing and see if that works.

Thank you again. :bow:

And thank you Balala for your consideration!
Never underestimate the power of stupid! :D
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: UserInput Default value not working

Post by eclectic-tech »

Happy to help! :welcome: