There are no graphic controls for action creation in routines (only text field to type command) - google-smart-home

To create any routine, user needs to enter full command in the text field. Is it possible to add additional graphic controls that can help user in creating a routine? For example, to provide possibility to select any commands from predefined list, provided to the user based on SYNC request. Do you consider any similar possibility or “browse popular actions” option is provided for this purpose? Could you please clarify if additional actions can be added to “browse popular actions” option? Can user customize them and how exactly? Could you please provide the examples?

As a developer there are no ways to add additional actions to the list. However, For specific types of actions, like controlling lights or thermostats, those devices will be surfaced and controlled through a specific set of controls.

Related

Best method in pyqt for assigning text to a variable according to whether or not the text box has been edited

I'm currently in the process of coding a GUI for one of the scientific instruments in my research lab. I have mild python experience, however pyqt is entirely new to me. I'm currently working on slots and signals for much of the interface and my current problem is one aspect of text edit.
You can see in the attached photo that I have placeholder text set in the text box for 'Path'. Normally this will never change, but I need it to have the capability to accept input if the user decides to change it. I need to assign this, whether it be the placeholder text or the user input, to a variable titled 'filePath'. What is my best method to accomplish this?
I was considering using an if statement that determines whether or not the text input has changed, but I cannot find the command on any website by which to do this. If there's a better method, I am open to that as well. Thanks for any help!

Create user control fields based on bound properties

I am creating a user control that I would like to be able to generate the form entry fields based on what custom data object the form is bound to. Basically, I have a drop-down box that allows the user to pick what type of data object they are working with (user, address, etc.) That choice will bind the user control to the related data object. No big deal there. I am stuck, however, on how to generate the form fields based on the properties of the object. I feel like I have seen examples of this in WPF but am not able to find them now. All form fields will be simple label, textbox combinations in a stackpanel.
I know more detial will probably be required. Let me know what specifically you would like to know. Any help of direction is greatly appreciated.
Best,
Ryan
It sounds like you are looking for something which runtime generated, but check out the Xaml Power Toys, which will do this at design time

What's the purpose of Winforms controls tags?

I see a 'Tag' property in the design view for most WinForms controls. I have never used this tag and want to know why I would want to use it.
It allows you to store some of your own data with a control. It mostly useful in tree controls where you might want each node/leaf to have some extra data associated with it. This way when you click on a node you can perform an action relevant to the node.
Its a general "catch-all" for additional data you wish to store with a control.
I too have never used it.
We perform heavy use of tags. We have some methods for checking input, and these methods checks whats in the tags in order to know what control to perform.
IE: if a textbox has RQ=1;DT=int;MAX=100
the automatic method knows that this text can not be left blank, that should accept only integers within 0 and 100.
We have a complete pseudo declarative language for this.
Kind of useful!
More specific for your question, Tags are for your use.
for example you have a lot of buttons with single method handling clicks. then at handler you have do differentiate them from each other. So you put some sort of id (or reference) and then access it there.

Input validation in Winforms

In good old MFC, the DDX routines would have built in validation for form entries. For example it was possible to automatically check if the user entered a string in a text box meant for numeric input.
Is there any such mechanism in Winforms? Obviously one can add handlers for the 'onChange' etc kind of events and do the processing there, but I am asking if there is any built-in mechanism.
thanks
You could certainly implement your own ValidatingTextBox with a Regex property which is validated, essentially, whenever you decide you want it to be validated (keystrokes, Enter key, loses focus, ...)
At the simplest level there are Validated and Validating events on the plain TextBox that you can supply handlers to for individual instances.
There have been a couple of attempts to replicate the richer ASP.NET validators on Windows forms. Check out this one by Billy Hollis
No, I don't believe so, but you can easily derive a custom textbox that applies the kind of validation you require based on a parameter or property you set on its instance. Then you'd have a built-in mechanism. ;-)

How do I enable/disable Cut/Copy/Paste menu and toolbar items in a generic way?

I have a windows forms application with controls like textbox, combobox, datagridview etc.
These controls allow a user to use the clipboad, i.e. cut/copy and paste text. It is also possible to delete text (which is not related to the clipboard).
My application has a menubar with an Edit item containing Cut/Copy/Paste/Delete items, and a toolbar with these items as well. How can I enable/disable these items properly depending in the state of the control having the focus?
I am looking for a generic way, i.e. I look for an implementation I do once, and can reuse for the future independent of the controls my application will use.
There is no generic interface or set of methods for getting cut/copy/paste information from a windows forms control.
I suggest your best approach would be to create a wrapper class for each type of control. Then when you want to update the menu state you get the current control with focus and create the appropriate wrapper for it. Then you ask that wrapper for the state information you need. That way you only need to create a wrapper implementation for each type of control you use. Bit of a pain to start with but other time you only need to add the new controls you come across.
Clipboard information is much easier as you can ask the Clipboard singleton if it has data inside and what type it is. Then again you still need to ask the target control if it can accept that type of information so there is still extra work needs doing.
Create an array for each enable/disable group. Add the controls to the array (of course it has to be of the correct type such as Object or Any, etc. depends on the programming language you are using).
Then to enable, disable just loop through the array and invoke the enable/disable method or function for each control. Again, depending on the language you may need to cast back.

Resources