Jump to content

Koda does not generate code for updown component


Recommended Posts

Posted Image

First, I didn't even have a context and updown1 didn't get generated. Then, I read in the helpfile that contextmenu is required (why?). So, I created a context menu with Koda and linked it to updown1's properties. But it still does not generate the updown code. I assume it is because of the context menu becuase the font is red. How can I generate the code in this little example?

Is it true that required fields are either red or green and red means there is a problem?

When I expand the context menu properties the children are green.

Edited by wuschelbeutel
Link to comment
Share on other sites

Even when I create an input control in Koda, it does not generate the updown code.

What's weird is that the following works (skipping the use of Koda completely):

GUICtrlCreateLabel("UpDown", 350, 115)
GUICtrlCreateInput("42", 350, 130, 40, 20)
GUICtrlCreateUpdown(-1)

Two things puzzle me:

1. What happens when you pass in -1 as the ID?

2. How does AutoIt know that it needs to associate the Updown with the Input without referncing the ID?

Edited by wuschelbeutel
Link to comment
Share on other sites

When a control ID is needed for a function, -1 will refer to the last control created, in this case the input control.

BTW, the help file doesn't say you need a context menu to create an UpDown control, you need an input control for it, as you found out in your second post.

Koda is a frame for your script, it doesn't do everything, and what it does do usually has to be tweaked after you've created the code because it makes assumptions about your script that you may not want. This is probably one of those things that need to be tweaked after it's been done in Koda.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

In Koda do this:

- place input and updown control on the form

- click on Input control and in Object Inspector set up "UpDown" property

- -> when you click on combobox's arrow you will see name of your UpDown control

Code is then generated without problems.

EDIT:

Colors in Object Properties dialog (as far as I know):

- red: those that can be linked to other controls

- green: events

Edited by Zedna
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...