Jump to content
Sign in to follow this  
nikosliapis

Arduino GUI Programmer

Recommended Posts

nikosliapis

The latest version of the GUI Programmer:

Vesion Changes :

0.22) Bug fixed when loading Rule for modifying

0.23) Adds the ability to set a Counter to a fixed value so that the user can "reset" the value of a Counter

0.24) Bug fixed: used to add a space infront of the Counters in inputs causing problems to simulator

Fixe the _check_syntax() function to accept 0 as value when output is a counter

0.25) - Prevent user entering a pin name containing the words "Virtual_Coil" or "Counter" because causes problems on the function

_update_rule_combos_others()

- Adds the autocomplete choise when apllying a new rule, which automatically creates another opposite rule

For example: if a rule is * Pin_0 = HIGH ==> Pin_5 = HIGH *

then the rule * Pin_0 = LOW ==> Pin_5 = LOW * will be automatically created

0.26) - Changed the generated code regarding Counters (each Counter will increase or dicrease only on input toggle)

0.27) - Show the Project name on the window title

- Help is available under "Help-How to"

0.28) - The settings combos are disabled only if they have been used inside a Rule

0.29) - Adds the abbility to use an Output as Input (Further testing required)

0.30) - Bug fixed: Pin_A5 was not updated to the rule combos

- New feature that enables user to compare 2 analog pins

- Improve the generated code conserning the expression feature. (Use of the constrain() Arduino command to limit the values and not if...then)

- Improve the generated code conserning analog inputs. (Map the values of AI to a range of 0-255 when reading the pin and not when writing the corresponting output. By doing the mapping at the begining there is no need to remap when comparison of analog pins)

- Change the header(top line) of the saved project (This is done so older versions of Arduino Simulator(V0.06 and below) wont open projects with the comparison feature, because they can't handle the rules.)

- Bug fixed: Wrong project name when "save as"

0.31) - Minor change in the order of the comparator when comparing analog pins (Division is the default selection)

- Show tip text associated with the controls

0.32) - Prevent user entering a pin name containing the character "", because it is used as delimiter at the "Boole calc" function and may create problems.

- Bug fixed: When the number of created rules where over 30 they didn't fit at the rule selection combo. Now a scrollbar appears if needed

- Three new alternative ways to create rules are added:

1) Boolean Calculator: A calculator like GUI Window that allows the user to create Logical (Boolean) Expressions which are

automatically transfered to Rules.

2) Boolean Truth Table (2 Inputs): A Truth Table ready for 2 inputs and 1 output. The entered data are automatically

transfered to Rules.

3) Boolean Truth Table (custom Inputs): A generalized Truth Table able to handle more inputs (1-9)

0.33) - Add a space option along with the "AND" and "OR" options in the rule combos

- Bug fixed: When the number of inputs is three and above then the opossite rules regarding Virtual Coils are also created.

- Bug fixed: Changed the way that counts the open and closed parentheses in the _create_output_from_bool_expression function

- When using Bool calculator, user can create an expression with an "Not" in the output to invert the output

- Bug fixed: Button 13 on Bool Calculator was not functioning. (An empty label was overlaping)

- Changed the symbols for "AND" , "OR" on boole calculator. Now the symbols are: AND -> "*" OR -> "+"

- Remove the counters from the combos on bool functions

0.34 - Add the "Preview Truth Table" feature on the Bool Calculator

- Some syntax check of the expression in the Bool Calculator

- In the "Boolean Truth Table (Custom Inputs)" tool all the possible states of inputs are automatically created

- Change the label showing the maximum number of inputs on the "Boolean Truth Table (Custom Inputs)" tool according to the daclared Digital Inputs

- Add the "Fill Inputs" button on the "Boolean Truth Table (Custom Inputs)" tool, which automatically sets all the possible states of the inputs

- Bug fixed: Program crash when rule was deleted twise

- Add a Clear Rules option under the Clear Settings Button

0.35 - Use of a much better way to generate Rules when the "Boole's Calculator" or "Boole's Truth table" are used.

The generated Rules and the Virtual Coils used are much less.

Arduino Programmer V0.30.au3

Arduino Programmer V0.35.au3

The latest version of the Arduino pseudo simulator:

Vesion Changes :

0.02) Counters increase (or dicrease) only when the triger input changes condition

0.03) Bug fixed: Counters were not increased (or dicreased) correctly when the same counter was declared in more than one rule

0.04) Display the type of each pin next to the pin

0.05) Create a list view which shows the rules of the project, so that the user can check on them when testing

Show the name of the current project on the window title

Bug fixed: Delete the labels that shows the pin state when a second project is opened

When the project doesn't have any Rules, Display an error message

The How to... under the help menu is active

0.06) Show the pin name next the pin

0.07) Corrections made to handle the new "Compare" feature

0.08) Show control tips when mouse hovers over them

0.09) User can view in real time the states and values of Virtual Coils and Counters

Arduino Simulator V0.07.au3

Arduino Simulator V0.09.au3

And some simple examples:

Examples.zip

Looking forward for comments and recomentations.

Thank you all very much

Edited by nikosliapis
  • Like 2

Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites
Qwerty212

Can wait to test it!

Thanks a lot for sharing it with us. Will give feedback on weekend

Share this post


Link to post
Share on other sites
martin

nikosliapis

Looks good!

If you enter a rule and press Generate_code and forgot to press Add_Rule then the script crashes because $rule_count is zero and you have Dim statements using $Rule_count for the number of elements..

I don't understand how an analogue input is used. If I try to create a rule using Pin_A0 for example, the choice is Gets High or Low

I think it would be helpful if the first window was kept so that additional pin settings could be made or corrected as rules are though up, and I think an essential addition is an option to save the settings as a project so that you can continue working on it another time.

I think it is better to keep the latest version in your first post with notes on the changes, otherwise people will have to search for the latest version and many would get the one in the first post which is out of date.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
nikosliapis

martin

First of all, thank you for your time testing my script

If you enter a rule and press Generate_code and forgot to press Add_Rule then the script crashes because $rule_count is zero and you have Dim statements using $Rule_count for the number of elements..

In the latest version the last rule must be completely empty in order to generate code otherwise an error message pops, promting the user to correct it by creating one last empty rule. (I know it's not the best thing :bye: but i am looking for a way to bypass this ;) . Perhaps it's better to test the syntax of rules when the "generate code" button is pressed and report to the user which rules has a syntax error). Indeed the program crashes when no rule at all is set, but what is the point generating arduino code with no rules :doh: .

Nevertheless i will adjust the program to generate only the "void setup()" function in such a case ;) .

I don't understand how an analogue input is used. If I try to create a rule using Pin_A0 for example, the choice is Gets High or Low

When an analog input or output are selected the user can write directly inside the combo box to set the value. For analog inputs the value must be between 0 - 1024 and for outputs between 0 - 255. For example:

post-54141-0-34876400-1332447092_thumb.j

I think it would be helpful if the first window was kept so that additional pin settings could be made or corrected as rules are though up

Of course you are correct. What i have in mind for future versions is to eliminate the first window. I am thinking to make the "Pin Information" corner the place to set the state of each pin. Truth is that, this was my first idea but i had a problem updating the options in the selection of inputs when a change on pin was made, so i let it go. I'm open to suggestions for eliminating this problem. :cheer:

I think an essential addition is an option to save the settings as a project so that you can continue working on it another time

Very usefull indeed. I will start working on a save and open option to save the project to a file.

I think it is better to keep the latest version in your first post

Allready done , what was i thinking ? :oops:

Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites
martin

When an analog input or output are selected the user can write directly inside the combo box to set the value. For analog inputs the value must be between 0 - 1024 and for outputs between 0 - 255. For example:

post-54141-0-34876400-1332447092_thumb.j

I see. It was not obvious to me because there is still a combo there so the appearance is that you should select from the combo list. I would prefer it if the combo was made invisible and an edit was made visible to replace it when an analogue input is selected, and preferably something like a label over the edit to prompt for the allowed range. Eg "(Enter value 0 to 1024)".

I will start working on a save and open option to save the project to a file.

I think this is a good AutoIt project :oops:

If you save the project then maybe you could consider another thing. I think there will problems unless you do something like Koda does.

What will happen is that people can start by using your programmer, but there will be sections of code they will want to write which are nothing to do with what your programmer does, or maybe they only want to add comments. At the moment the only way to deal with this is to have one file for your project, and copy and paste sections from the code your program produces.

So you could have a file for the Arduino code, and when you write a rule for example, you write comments before and after, like this

//rule 17 region!!Do not change the code in this region it is maintained by the NAG Programmer.
if (dig_in_state[0] == HIGH) {
    digitalWrite(dig_out[0], LOW);
  }
//rule 17 endregion

Then when you update rule 17 you copy the file up to "//rule 17 region", write the new rule and write everything from "//rule 17 endregion" onwards. That way people can add whatever code they like and there is no need to copy and paste.

I have these problems

There seems to be no option to set analogue outputs yet.

If I try to change a rule I am told that the output has not been set even if it has been set.

There seems to be no way to remove a rule.

If I change a rule which has been saved it seems to have no effect and I can enter incorrect data.

Your labels overlap the combo boxes and this shows up when you add a rule.

It would be good if instead of only dealing with the last rule, as I think your program does (though I haven't examined your code) then you should examine the rule where the last change was. This could be quite difficult. So maybe instead you could have a fixed set of edits and comboboxes. When you say "add rule" the rule is added to an edit say with a reference like rule 5. Make the edit read only. Maybe a listview would be better, then you could click on a line to select the one you want to change. You can make an extra combo box at the start of the line which contains the list of rule numbers. "1,2,3,4, New Rule" for example. Then you could edit a rule without any confusion and your program would be a bit simpler perhaps. You could have a Delete button to delete the currently displayed rule, or maybe you should just empty the rule so it can be reused and so that the references stay the same for other rules.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
nikosliapis

There seems to be no option to set analogue outputs yet.

The pins that have the ability to be declared as Analog Outputs are marked with a " ~ " next to the pin name (same as the Arduino board).

In order to declare that pin as Analog Output you must select the "AO" option as shown below:

post-54141-0-98943200-1332576214_thumb.j

Your labels overlap the combo boxes and this shows up when you add a rule.

Fixed in the latest version :oops:

That way people can add whatever code they like and there is no need to copy and paste.

If i understand correctly, you recommend to add comments in the Arduino code marking the Rule from which this part of the

code was generated so that it is easier for the user to identify and it ?

Please verify my assumption.

So maybe instead you could have a fixed set of edits and comboboxes. When you say "add rule" the rule is added to an edit say with a reference like rule 5. Make the edit read only. Maybe a listview would be better, then you could click on a line to select the one you want to change. You can make an extra combo box at the start of the line which contains the list of rule numbers. "1,2,3,4, New Rule" for example. Then you could edit a rule without any confusion and your program would be a bit simpler perhaps. You could have a Delete button to delete the currently displayed rule, or maybe you should just empty the rule so it can be reused and so that the references stay the same for other rules.

Can you please provide a draft GUI of what you have in mind.

Manipulating "real time" changes in the rules is a very BIG issue and i'm afraid goes beyond my coding abilitys. Hopefully i will manage to overcome it.

If I try to change a rule I am told that the output has not been set even if it has been set.

Please provide a screenshot

Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites
martin

The pins that have the ability to be declared as Analog Outputs are marked with a " ~ " next to the pin name (same as the Arduino board).

In order to declare that pin as Analog Output you must select the "AO" option as shown below:

post-54141-0-98943200-1332576214_thumb.j

Yes but maybe it was a problem I had when I tried to change a saved rule. I can't reproduce it with your lates version (which is much better by the way)

If i understand correctly, you recommend to add comments in the Arduino code marking the Rule from which this part of the

code was generated so that it is easier for the user to identify and it ?

Please verify my assumption.

No. That's not what I mean at all. I haven't described trhe problem well enough so let me try a different way. How should a user build a project using your programmer to help him? This is what I would do but I soon run into trouble.

1. I start with an idea of what I want and how I will achieve it. Of course things will change as I go along.

2. I begin with your NAG programmer and I create a few rules. This gives me some code.

3. I work on the code adding things which I want. Maybe a wifi shield or a display. Maybe I just add some comments but it could be anything.

4. I decide that I need some more rules for inputs, or that I need to change a rule so I go back to your programmer.

5. I create the new rule or ciorrect an old one by editing the saved project (I know this is not avaialable yet). The first problem is that there is no way for an existing rule to be changed using your present version. But even if you create one, how are you going to correct the rules which are in my developed source code without either wiping out my hours of work, or just giving me some code which I have to spend much too long on copying and pasting to my project source code. Unless you have some way of replacing existing rules in the source code with changed ones, or even of avoiding dulpicating rules, then the system is too difficult to use so people won't use it. You will have given people a tool which converts a job into a more difficult and longer job.

If you haven't used Koda then I recommend that you do because it creates the graphical code. You can add whatever code you want to the script and then if you modify the gui using Koda it will update the gui parts and leave your nice code alone. You have to have sometjing like that IMO.

Can you please provide a draft GUI of what you have in mind.

Please provide a screenshot

OK, here's what I was thinking but it's only a suggestion.

That way you can have a vertical scroll bar for the listview, you can select a rule by clicking on the line etc. You only need one set of combo boxes and you don't need to keep creating new ones for new rules. When you create code you just go through the list as you must do already, but the problem is the maintenance of the source code which I mentioned before. It would be good if you gave the option to add a comment for a rule such as "// turn on lights when it gets dark".

It is very likely that I'm being too demanding but it's easy to ignore me :oops:

Manipulating "real time" changes in the rules is a very BIG issue and i'm afraid goes beyond my coding abilitys. Hopefully i will manage to overcome it.

Real time isn't needed at all. It is not really different than what you are already doing. You copy the old source code to a new file untill you come to a rule , you write the new version of that rule to the new file, carry on copying from after the rule in the old file and so on. (You have to allow for the user rearranging the rules in the source code so they might not be in order any more.Then rename the old file to a backupversion and rename the new file to the old file name. You can definitely do it based on what you have done so far.

The bit that you didn't understand about my comments suggestion is that was how I think you can identify where the existing rules are in the application source code.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
nikosliapis

It is very likely that I'm being too demanding but it's easy to ignore me

Progress comes through what other people want and need.

The hall concept of this forum is to make programs and UDF that other people will happily use.

Please never stop asking for improvements.

Looks like A LOT of work needs to be done. :bye::oops:


Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites
Scriptmaster

I love

Arduino!!!!!!!!!


shutdown(1)

Share this post


Link to post
Share on other sites
storme

I've watched Arduino and if I'd been around years ago a lot of my "ideas" then would be reality now. :oops:

But now in my old age (46) everything I can think of doing with it I consider to be a waste of money for what it gives me or just way too exspensive. ;)

I'd love to get it into using them but just can't find a "usefull" project that won't cost the earth. :bye:

OH and one I can show the wife and say SEE computers can do usefull things in the "real-wiorld". :doh:

Any ideas?

Share this post


Link to post
Share on other sites
JScript

@storme

Only one, because the circuit responsible for recognition of the phone off-hook is made by transistors, together with the ring!

The problem is the array of conversation, I'm still thinking about how to do it without using dedicated ICs.

Regards,

João Carlos.


http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
Share on other sites
martin

Hey guys! The previous 5 posts have really nothing to do with this thread so show some consideration for nikosliapis and people who want to follow the progress of the NAG programmer and lets keep on track.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Qwerty212

Program looks fantastic. Just a pair of ideas:

When the program prompts for an error you launch a Msgbox:

#region **Add New Rule** Create next Rule =========================================================================================================================================
    ; If syntax is not correct then display the apropriate message promting the user to correct it
    If $check_input_1_value = -1 Then
     MsgBox (0,"Input_1_value ERROR", "Input_1 is declared as Digital input and it's value is not High or Low. Fix and continue")

It would be better if you use this Msgbox code:

MsgBox(262160,"Input_1_value ERROR", "Input_1 is declared as Digital input and it's value is not High or Low. Fix and continue")

So there will only can be one Msgbox at time at it will be over everything on the screen (if you click quickly to "Generate Code" 2 or three times you'll see the current problem).

And a visual feature: wouldn't it be great to prompt the user for the kind of Arduino Board is s/he using and change the graphic for an image of the board like these?

Posted Image

Congratulations and thanks for your program, it looks great.

Share this post


Link to post
Share on other sites
pierrotm777

It's a great script .

Thanks for this share

Share this post


Link to post
Share on other sites
nikosliapis

Thank you all for your comments.

It would be better if you use this Msgbox code:

Indeed is better will be changed in future versions

And a visual feature: wouldn't it be great to prompt the user for the kind of Arduino Board is s/he using and change the graphic for an image of the board like these?

I think this feature will be like "A cherry on the top" for my program :bye: . My script is still in infancy :oops: , so there is still a lot of work to be done and a lot of technical problems to solve.

Anyway i followed martin's suggestion, and i am working on a new interface for my script. It is not yet complete but here is a screenshot of what

it will look like:

post-54141-0-96025300-1332769167_thumb.j


Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites
martin

Looks good!

I'm looking forward to trying your new version when you're happy with it.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
nikosliapis

New interface version released . :oops:

Of course many work left to be done

Last version available on first post.


Coding can be fun when you do it your own.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • Pricehacker
      By Pricehacker
      Hello again!
      I have tried searching for quite some time now but couldn´t find a single working way to change the class of your GUI that doesn´t include changing it manually after its compilation.
      First or "AutoIt v3 GUI" is a pretty boring name tbh and i would like to spice it up a bit, also, and more importantly, I would like to identify my windows by something other than its title as it will change depending on some factors and im using two different programs independently as multi threading isn't supported.
      Any help is appreciated! Thank you!
    • xtcislove
      By xtcislove
      Hello, 
      i have a Problem with  _WinAPI_SetLayeredWindowAttributes, everything is working as excepted if u are on Windows 7.

      But if u are on Windows 10 the transparent background of a control is not clickable anymore. 

      Could someone help?

      Please see example below, put cmd.jpg into the same folder as Example.au3

      Please see trigger.jpg to see which sections are not clickable in Windows 10 (the red dots, the green dots are clickable) on Windows 7 the red ones and green ones are clickable.
       
      The same problem occurs if i use 
       
       
      Example.au3


    • WilliamasKumeliukas
      By WilliamasKumeliukas
      Hello everyones reading this post,
      I'm struggling at resizing properly my radio buttons to fit long text inside without affecting others radio buttons and also adjust position of them relative to the string.
      I tried with _StringSize UDF but I guess im too tired to figure out how to use it correctly..
      I also tried: _Control_SetWidth2Text I found on this forum, it work aslong im not maximizing GUI (radio text is gone when I maximize and maximize is a must)
       
      here is the code example, I hope someone can figure out (sorry if guictrlsetpos is not included in the example, I know thats probably the way to go but I wanted to make sure there is nothing better before use it)
      Thank you
       
      Br,
      ~WilliamasKumeliukas
       
      #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Array.au3> #include <StringConstants.au3> #include <FileConstants.au3> #include <WindowsConstants.au3> #include <File.au3> #include <EditConstants.au3> #include <GUIListBox.au3> #include <ButtonConstants.au3> #include <ProgressConstants.au3> #include <ColorConstants.au3> #include <AutoitConstants.au3> #include <Misc.au3> #include <WinAPIReg.au3> #include <WinAPI.au3> #Region Opt's Opt("GUIResizeMode", 802) #EndRegion Opt's Global $q = "INTRO LINE" & @CRLF & @CRLF & "description of everything until user press start." Global $file = @TempDir & "\test.p" destroy() Global $msg, $score = 0, $rate, $com, $total = 0, $cfile, $cq, $i = 0, $time = 0, $min = 0, $sec = 0, $hour = 0, $qf, $ii = 0 Main() Func Main() Global $iGUIInitSize = 550 #Region GUI Opt("GUICloseOnEsc", 1) Global $gui = GUICreate("example", 1124, 550,-1 ,-1, BitOR($WS_MAXIMIZEBOX , $WS_MINIMIZEBOX)) Global $gui_size = WinGetClientSize($gui) Global $iFontSize = Int(2 * (.25 + (8 * $gui_size[0] / $iGUIInitSize))) / 2 Global $options = GUICtrlCreateMenu("&Options") Global $guide = GUICtrlCreateMenuItem("Guide", $options) Global $restart = GUICtrlCreateMenuItem("Restart", $options) Global $about = GUICtrlCreateMenuItem("About", $options) Global $exit = GUICtrlCreateMenuItem("Exit", $options) Global $extra = GUICtrlCreateMenu("Extras") Global $creator = GUICtrlCreateMenu("CQB", $extra ) Global $new = GUICtrlCreateMenuItem("custom QP", $creator) Global $load = GUICtrlCreateMenuItem("CQ", $creator ) Global $timer = GUICtrlCreateLabel("", 752, 472, 294, 30, $WS_BORDER) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetFont(-1, $iFontSize) GUICtrlSetState($timer, $GUI_HIDE) Global $info = GUICtrlCreateLabel( $q, 200, 20, 700, 200, $SS_CENTER ) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) $fi = GUICtrlSetFont($info, $iFontSize) Global $a = GUICtrlCreateRadio("A)", 100, 210, $WS_EX_CLIENTEDGE) $fa = GUICtrlSetFont($a, 15) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($a, 16) Global $b = GUICtrlCreateRadio("B)", 100, 310 , $WS_EX_CLIENTEDGE) $fb = GUICtrlSetFont($b, 15) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($b, 16) Global $c = GUICtrlCreateRadio("C)", 750, 210 , $WS_EX_CLIENTEDGE) $fc = GUICtrlSetFont($c, 15) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($c, 16) Global $d = GUICtrlCreateRadio( "D) ", 750, 310, $WS_EX_CLIENTEDGE) $fd = GUICtrlSetFont($d, 15) GUICtrlSetResizing (-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER) ) GUICtrlSetState($d, 16) Global $sign = GUICtrlCreateLabel( $file, 420, 480, -1, -1, BitOR ( $SS_CENTER, $WS_BORDER ) ) GUICtrlSetResizing ( -1, BitOR ( $GUI_DOCKHCENTER, $GUI_DOCKVCENTER ) ) GUICtrlSetFont($sign, 12) Global $yb = GUICtrlCreateRadio("True", 200, 420, 200, 50, $BS_PUSHLIKE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER,$GUI_DOCKSIZE)) GUICtrlSetFont($yb, 15) GUICtrlSetState($yb, 32) Global $nb = GUICtrlCreateRadio("False", 700, 420, 200, 50, $BS_PUSHLIKE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER, $GUI_DOCKSIZE)) GUICtrlSetFont($nb, 15) GUICtrlSetState($nb, 32) Global $start = GUICtrlCreateButton("Start", 20, 20, 100, 50, $SS_CENTER, $WS_EX_CLIENTEDGE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER)) GUICtrlSetFont($start, 12) Global $valid = GUICtrlCreateButton("Confirm", 20, 20, 100, 50, $SS_CENTER, $WS_EX_CLIENTEDGE) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER)) GUICtrlSetFont($valid, 12) GUICtrlSetState($valid, 32) GUISetState(@SW_SHOW) #EndRegion GUI While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Switch MsgBox(4096 + 4, "Warning", "Are you sure to exit?") Case 6 AdlibUnRegister("timer") If Not $qf = "" Then FileClose($file) EndIf Exit Case 7 ContinueLoop EndSwitch Case $start ;AdlibRegister("timer") ;Global $qf = StringSplit(StringStripWS(FileRead($file), 6), @CRLF, 0) ;qloop($file) GUICtrlSetData($a, "A) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") GUICtrlSetData($b, "B) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") GUICtrlSetData($c, "C) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") GUICtrlSetData($d, "D) This long string is an example as string that I want to fit in 4 radio buttons because sometimes it can be that long.") Case $restart MsgBox(4096, "Warning", 'Normally, your suposed to start something before restarting it.') ContinueLoop Case $new ;GUISetState(@SW_HIDE, $gui) ;_CustomNew() ContinueLoop Case $load ;_CustomLoad() Case $about ;_About() EndSwitch WEnd EndFunc ;Main() Func timer() If $time = 0 Then Global $time = TimerInit() Global $diff = TimerDiff($time) Global $sec = Int(Mod($diff / 1000, 60)) Global $min = Int(Mod($diff / 60000, 60)) Global $hour = Int($diff / 3600000) If $sec < 10 Then $sec = "0" & $sec If $min < 10 Then $min = "0" & $min If $hour < 10 Then $hour = "0" & $hour GUICtrlSetData($timer, "Temps: " & $hour & ":" & $min & ":" & $sec) EndFunc ;==>timer Func destroy() If FileExists($file) Then FileDelete($file) EndIf DirCreate(@TempDir & "\About") FileInstall("C:\test.txt", $file) EndFunc ;==>destroy  
    • xtcislove
      By xtcislove
      Hello,

      im searching like 6 hours and i didnt found the right solution.

      Im trying to build a treeview from a directory and its subfolders etc.

      This function give me right treeview, but i cant color each item seperated.

       
      #include <GuiTreeView.au3> $hGui = GUICreate("Demo1", 600, 400) $hTreeView = _GUICtrlTreeView_Create($hGui, 10, 10, 580, 380) GUISetState() _GUICtrlTreeView_BeginUpdate($hTreeView) ListFiles_ToTreeView(@ScriptDir, 0) _GUICtrlTreeView_EndUpdate($hTreeView) Do Until GUIGetMsg() = -3 Func ListFiles_ToTreeView($sSourceFolder, $hItem) Local $sFile ; Force a trailing \ If StringRight($sSourceFolder, 1) <> "\" Then $sSourceFolder &= "\" ; Start the search Local $hSearch = FileFindFirstFile($sSourceFolder & "*.*") ; If no files found then return If $hSearch = -1 Then Return ; This is where we break the recursive loop <<<<<<<<<<<<<<<<<<<<<<<<<< ; Now run through the contents of the folder While 1 ; Get next match $sFile = FileFindNextFile($hSearch) ; If no more files then close search handle and return If @error Then ExitLoop ; This is where we break the recursive loop <<<<<<<<<<<<<<<<<<<<<<<<<< ; Check if a folder If @extended Then ; If so then call the function recursively ListFiles_ToTreeView($sSourceFolder & $sFile, _GUICtrlTreeView_AddChild($hTreeView, $hItem, $sFile)) Else ; If a file than write path and name _GUICtrlTreeView_AddChild($hTreeView, $hItem, $sFile) EndIf WEnd ; Close search handle FileClose($hSearch) EndFunc ;==>ListFiles_ToTreeView
      So i am searching for the exact same function just with
      GUICtrlCreateTreeViewItem
      instead of 
      _GUICtrlTreeView_AddChild
       
      Ps: i have a folder structure where i like to color each item green if a file only exist once and red if it exist more than once.

      Could someone help?
       
      Solution:

       
       
    • Pricehacker
      By Pricehacker
      Title pretty much says it all. Im wondering what button the "primary mouse button" is, and while im here i would also like to know what the "secondary mouse button" is. I´m guessing its the left and right mouse buttons but i could not confirm this.
      Thank you!
×