AHK GUI issue - edit variables not pulling through - user-interface
I have made a script GUI for AHk which has several input boxes.
The problem comes when I try to enter information and click OK it does not seem to save/assign this info to each variable I have set in the code.
Here is the code:
Gui, Add, Text, x20 y10 w120 h20, Date:
Gui, Add, Edit, x80 y10 w120 h20 vDate,
Gui, Add, Text, x20 y40 w120 h20, Time:
Gui, Add, Edit, x80 y40 w120 h20 vTime
;Material 1
Gui, Add, Text, x20 y70 w120 h20, Material 1:
Gui, Add, Edit, x80 y70 w120 h20 vMaterial1
Gui, Add, Text, x217 y70 w120 h20, Quantity:
Gui, Add, Edit, x267 y70 w80 h20 vQuantity1
Gui, Add, Text, x367 y70 w120 h20, Unit of measure:
Gui, Add, Edit, x453 y70 w60 h20 vUnit1
;Material 2
Gui, Add, Text, x20 y100 w120 h20, Material 2:
Gui, Add, Edit, x80 y100 w120 h20 vMaterial2
Gui, Add, Text, x217 y100 w120 h20, Quantity:
Gui, Add, Edit, x267 y100 w80 h20 vQuantity2
Gui, Add, Text, x367 y100 w120 h20, Unit of measure:
Gui, Add, Edit, x453 y100 w60 h20 vUnit2
;Material 3
Gui, Add, Text, x20 y130 w120 h20, Material 3:
Gui, Add, Edit, x80 y130 w120 h20 vMaterial3
Gui, Add, Text, x217 y130 w120 h20, Quantity:
Gui, Add, Edit, x267 y130 w80 h20 vQuantity3
Gui, Add, Text, x367 y130 w120 h20, Unit of measure:
Gui, Add, Edit, x453 y130 w60 h20 vUnit3
;Material 4
Gui, Add, Text, x20 y160 w120 h20, Material 4:
Gui, Add, Edit, x80 y160 w120 h20 vMaterial4
Gui, Add, Text, x217 y160 w120 h20, Quantity:
Gui, Add, Edit, x267 y160 w80 h20 vQuantity4
Gui, Add, Text, x367 y160 w120 h20, Unit of measure:
Gui, Add, Edit, x453 y160 w60 h20 vUnit4
;Material 5
Gui, Add, Text, x20 y190 w120 h20, Material 5:
Gui, Add, Edit, x80 y190 w120 h20 vMaterial5,
Gui, Add, Text, x217 y190 w120 h20, Quantity:
Gui, Add, Edit, x267 y190 w80 h20 vQuantity5,
Gui, Add, Text, x367 y190 w120 h20, Unit of measure:
Gui, Add, Edit, x453 y190 w60 h20 vUnit5
Gui, Add, Button, x80 y240 w70 h20, OK
Gui, Add, Button, x167 y240 w70 h20, Cancel
Gui, Show, x100 y100 h270 w550
Return
ButtonCancel:
GuiClose:
ExitApp
ButtonOk:
Gui, submit, Nohide
;test ----
MsgBox unit material 4 - %vUnit4%
ExitApp
I tried re-arranging the variable names with no results.
I have a message box after the script is done as a check during development to check if the variables were captured but it doesnt seem to work
No need to use v.
Use %Unit4% instead of %vUnit4% if you want to do stuff with the variable.
Value entered via UI will be correctly displayed:
MsgBox unit material 4 - %Unit4%
Of course keep v here:
Gui, Add, Edit, x453 y160 w60 h20 vUnit4
More info on variables are in documentation (have a look at V:Variable section)
https://www.autohotkey.com/docs/commands/Gui.htm#Events
Related
Unable to modify label text in the past for a simple Pine Script
I'm trying to modify the text for labels already plotted on the chart, but I'm not able to. Example: in this Pivot script I want to change the black check mark symbol to a red X when price moves above the high of the Pivot Candle. Meaning that all Pivot Candles whose highs are lower than current price should be red Xs. In this image the red circles represent what should be red Xs, while the green circles are right as they are. Thank you in advance! //#version=4 study("change labels in the past", overlay=true) // Pivot definition highPiv = pivothigh(high, 2, 2) barcolor(highPiv ? color.blue : na, offset=-2) // If price at the current time is higher than any High Pivot, change the Pivot Icon to a red X (oonly the ones currently under the price line) HighVal = valuewhen(highPiv, high[2], 0) priceOverHigh = close > HighVal if highPiv a=label.new(bar_index[2], close[2], text="✔️", style=label.style_label_down, color=color.new(color.black, 100), size=size.normal) if priceOverHigh label.set_text(id=a, text="❌")
How to make image background white instead of black?
I am a beginner. I have this kv code: <Pat_layout>: BoxLayout: orientation: "vertical" size: root.width, root.height Label: id: name_label text: "Exercises Appear Here" font_size: 32 Image: id: image_window size_hint: (1, .5) source: 'images/dim_6543.jpg' Button: background_normal: '' background_color: 0, .3, .4, .95 size_hint: (1, .5) font_size: 32 text: "Press For Next Exercise" on_press: root.press() And I get this: output image with label, image, button The chord diagram should have a white background. I have searched and tried things for hours, days. How can I get the middle section, the image, to show a white background around the chord diagram? The chord diagram does not have any surrounding background; it's been cropped to just the diagram. Any help would be tremendously appreciated.... Thank you.
You want to draw a white rectangle filling the Image. The code for this is something like: Image: canvas.before: Color: rgba: 1, 1, 1, 1 Rectangle: pos: self.pos size: self.size
Yay, thanks inclement! I copied your code in and it works perfectly! Thank you! Jim
How can I get SPSS line chart to intersect graph at 0,0?
I need to get the attached line graph to go through the chart at (0, 0) (x, y) in SPSS. I have edited the chart with red to denote what I want the graph to look like. Does anyone know how to do this? For the variables, I have the time variable (x-axis) type as "Date" and measure as "Scale." SPSS Line Graph
1. Add 0, 0 Point to Data & Variable View Navigate to "Variable View" and make sure both variables are set to "Scale" for "Measure." To X and Y data, add a point for 0, 0. 2. Change Graph to Scatter Plot Graphs > Legacy Dialogs > Scatter/Dot > Simple Scatter > Define > Enter X and Y variables > Click "Ok" 3. Edit Axes in Chart Editor In the output file, double click the chart to activate the "Chart Editor" window. Double click the Y-axis to bring up the "Properties" window and edit lower and upper margins. Y-axis > Properties > Scale > Lower Margin = 0, Upper Margin =0 Double click the X-axis to bring up the "Properties" window and edit lower and upper margins. X-axis > Properties > Scale > Lower Margin = 0, Upper Margin = 0 4. Add a Line In the "Chart Editor" window, double click the points on the graph to bring up the "Properties" window. In the properties window: Variables > Interpolation Line Graph
Excel-change cell formula dependent on input to another cell
I hope I'll be clear. C13 has a Formula =E13/1.21 I want that if F13 has an X then C13 should have =E13 E13 has the base price of the item I need C13 to show the price including VAT (%21 here) unless there is an X in F13, then C13 would show the same as E13 thx
Animation in XPCE/prolog not smooth enough
I am trying to write a simple animation in XPCE/Prolog for a project, but it is not smooth enough; it appears flashing or flickering. I run this on an ASUS N550jv laptop with Intel i7 (quad core, 2.4 Ghz+), so this shouldn't be a problem. The moving object is always the same (just drawing it at different positions), double-buffering is explicitly enabled, I'm using 40 FPS. What could be done to improve the smoothness? Here is the code I'm using: sm:- %run this sm(600,4,40). %runs animation over 600 pixels, 4 seconds long, with 40 FPS sm(Length,Duration,FPS):- (object( #window),!,free(#window);true), %check is window exists; if it does, delete it (object( #floor), !, free( #floor); true), %check is floor exists; if it does, delete it (object( #box), !, free( #box); true), %%check if box exists; if it does, delete it new( #window,picture('Window',size(900,300))), %create window send( #window,open), %display window send(#window,buffered_update,true), %make sure to use double-buffering new( #floor,box(800,10)), %create floor send( #floor,fill_pattern,colour(green)), %colour floor send( #window,display,#floor,point(50,70)), %show floor new( #box,box(50,50)), %creates box send( #box,fill_pattern,colour(yellow)), %colours box yellow Frames is Duration*FPS, %how many frames are to be drawn Step is Length/Frames, %what's the distance between steps Delay is 1/FPS, %what is the delay between steps send( #window,display,#box,point(50,20)), %shows Object send( #window,flush), %flushes window ani(Step,Delay,Frames,point(50,20)), %actual animation sleep(1), %wait 1 second, and then free( #box), %delete box free( #floor), %delete floor free( #window). %delete window (and exit) ani(_,_,0,_). ani(Step,Delay,Frames,point(X,Y)):- send( #box,x(X+Step)), %moves box to the right send( #window,flush), %flushes repeat, sleep(Delay), FramesLeft is Frames - 1, NewX is X + Step, ani(Step,Delay,FramesLeft,point(NewX,Y)).
You should use a timer, it avoids sleep : sm:- %run this sm(600,4,40). %runs animation over 600 pixels, 4 seconds long, with 40 FPS sm(Length,Duration,FPS):- (object( #window),!,free(#window);true), %check is window exists; if it does, delete it (object( #floor), !, free( #floor); true), %check is floor exists; if it does, delete it (object( #box), !, free( #box); true), %%check if box exists; if it does, delete it (object( #my_timer), !, free( #my_timer); true), %%check if box exists; if it does, del new( #window,picture('Window',size(900,300))), %create window send( #window,open), %display window send(#window,buffered_update,true), %make sure to use double-buffering new( #floor,box(800,10)), %create floor send( #floor,fill_pattern,colour(green)), %colour floor send( #window,display,#floor,point(50,70)), %show floor new( #box,box(50,50)), %creates box send( #box,fill_pattern,colour(yellow)), %colours box yellow Frames is Duration*FPS, %how many frames are to be drawn Step is Length/Frames, %what's the distance between steps Delay is 1/FPS, %what is the delay between steps send( #window,display,#box,point(50,20)), %shows Object send( #window,flush), %flushes window ani(Step,Delay,Frames,point(50,20)). ani(Step,Delay,Frames,point(X,Y)) :- send( #box,x(X+Step)), %moves box to the right send( #window,flush), %flushes new(#my_timer, my_timer(Step, Delay, Frames, X)). :- pce_begin_class(my_timer, object). variable(mytimer, timer, both, "timer lançant l'animation fréquence 20 fois par seconde"). variable(step, number, both, "delta x"). variable(frames, number, both, "number of moves"). variable(posX, number, both, "xpos of the box"). % initialisation of the tmer initialise(P, Step, Delay, Frames, PosX) :-> send(P, slot, step, Step), send(P, slot, frames, Frames), send(P, slot, posX, PosX), send(P, mytimer, new(_, timer(Delay,message(P, my_message)))), send(P?mytimer, start). % must be called before destruction % avoid any problem of non-freed resources unlink(F) :-> send(F?mytimer, stop), send(F, send_super, unlink). my_message(P) :-> get(P, slot, frames, Frame), ( get(Frame, value, 0) -> send(P?mytimer, stop), free( #box), %delete box free( #floor), %delete floor free( #window), %delete window (and exit) free(#my_timer) ; get(P, slot, step, Step), get(P, slot, posX, PosX), send( #box,x(PosX+Step)), %moves box to the right send( #window,flush), %flushes send(PosX, plus, Step), send(Frame, minus, 1)). :- pce_end_class.