I have a script developed to create a task scheduler where it has 3 GUI buttons 'Add', 'Edit' and 'Remove' in the scheduler window. Clicking on 'Add' will open a task scheduler window where user can set the task,date,time and task name,etc.,after applying the settings and when clicked on 'ok', the GUI returns back to scheduler window updated with the set task name details of it in the list.Whereas 'Edit' window is used to edit the task scheduler selected from the list.I have class called 'class AddTask' which is the event created when clicked on 'Add' button.Similarly when clicked on 'Edit' i am calling the same AddTask class by creating a object of it from which i call edit function.I want these 'AddTask' and 'EditTask' should be independent class and function as they are expected to.
I want the GUI for both Add and Edit button must be same but the functionality's should be different,for ADD it has to add the task and update it in the list in the scheduler whereas for EDIT it has to edit the task scheduler which is selected from the list.
I personally would use an ObjectListView widget rather than a ListCtrl as I find ObjectListView to be easier to update. Either way, for the Add/Edit frame, you can just add an argument called "fields" or some such and set it to None.
class AddTask(wx.Frame):
#------------------------------------------------------------
def __init__(self, parent, id, title, fields=None):
Then you can call it the normal way for Adding data. However, when you go to call it for Editing, you will pass a list (or a dict) of the values from the ListCtrl to fill in the fields in this frame. You'll need to add something like
if fields:
# set the values of the widgets as necessary
self.field.SetValue("Task Name")
This is what i tried
def UpdateList(self,task):
run="Disabled"
status="Not Scheduled"
date=datetime.now().strftime("%d-%m-%Y")
self.List=[{"taskname":"%s"%(task),"run":"%s"(run),"date":"%s"(date),"status":"%s"%(status)}]
list1=self.listOlv.SetObjects(self.List)
Related
I have a function that I'm using to grab properties of a widget when a user changes it's input for undo/redo functionality. I have entries connected such that when a user clicks on them (focus-in-event), the current text is taken and stored. However, I've been having a big problem trying to do this with a file chooser or file chooser button. For some reason, when I click the button or chooser, and I have my handler wired to the focus-in-event signal, the filename is not grabbed. I'm not sure how to grab this value before the user changes it. I'm using glade to attach handlers to signals. Thanks!
You can achieve this by calling the get_filename method within a selection-changed callback. The response signal runs when the ok, or cancel button is clicked, and can be used to set or update which file/folder is selected to perform actions on.
I have a node that I'd like to add a button to within it's Attribute Editor panel, such that when the user clicks on said button, a method belonging to the node is called.
I have some knowledge of creating custom commands and making Attribute Editor templates, but I'm not sure how to specifically call a method within the node class (and not a custom registered command or MEL function), nor how to add a button with the C++ API.
To add buttons you need to use the corresponding MEL commands. You can use the MGlobal::executeCommand function to use them from C++.
See the documentation for the button command for how to create buttons with actions.
To call a method from your C++ code you need to create a command for it by implementing MPxCommand and registering your class with MFnPlugin.registerCommand. Then you can run it everwhere where MEL commands can be run.
I want to create a custom action bar in my app like the Play Store Action bar so I can have some Back to Home and Search buttons. I'm beginner to Android development and don't know how can I do it.
How can I add these buttons and have this action bar remain in all activity layouts?
Also, how can I create a class that universally handles searches and click events from this action bar without hardcoding in each activity?
I found a solution for my problem.
for creating action bar , my solution is creating a layout and disable native action bar in style.xml by this tag
<item name="android:windowNoTitle">true</item>
then use your own layout instead of native layout.
for handle action bar universaly in all activities instead of writing repetitious codes it's better to create a base class that extends from Activity class and use this class as parent class of other activities instead of using Activity as parent. then write methods in parent class for handle action bar like click event and etc...
Best Regards
Ali
The requirements is like master detail grid, on load the master gets displayed as a table, on every detail row edit button click , need to open the detail edit form in a Modal window. There could be different templates based on detail/productTypes . For example productType1 will display few set of fields(template 1) , so on.
Have WEBAPI with REST support and understand how to build the initial Master table But not sure on how the details part.
Any direction would be helpful.
Does your HTML/CSS Framework provide mechanism for a dialog? If so you would have to create a directive to wrap it around the script to open the dialog.
On the master grid row ng-click will set a flag on the controller. When this flag is set to true, the code in directive will open the dialog. Within that dialog div you can use ng-include that will be bound to the url of the template (controller variable will store that url).
The template is bound to a child object in the controller scope and has the fields for the details. Setting the flag to false will close the dialog and you will have changes your main controller.
I have created a Windows Shell Extension similar to Google's GDrive. Now I want to add different views to the ListView that inherits from IShellView. A new context menu has been added to to display 3 views (Details, Small Icon, Large Icon). When a view is changed using the context menu, the current window needs to be refreshed/created to display the changed view.
In my IShellFolder::EnumObjects, a new ListView object is created and OnCreate is called automatically. I need to call this method when I change view using the context menu also. I guess there might be some API like SHChangeNotify() that can all the EnumObjects() automatically and a new IShellView window will be created with the changed view.
As i understood from your question, you need the same contents to be viewed in listview but with the new view.
You don't need to recreate the Listview object after the new view mode selection, Just set the ListView's style to LVS_REPORT, LVS_SMALLICON, or LVS_ICON.
SHChangeNotify is used to reflect the change to the tree pane not the ListView.