When dealing with UserForm input, I prefer to create objects and set them equal to the various controls. Despite my best efforts, I cannot set a reference to a RefEdit control without triggering a compile error. I have checked that I have the correct references, tried both the options provided in Intellisense and exhausted my google-fu. What am I doing wrong?
The RefEdit in your intellisense menu (highlighted) is the object library - and you need the data type (which is the one listed below it in the same menu).
Try:
Dim cellSelectionBox As RefEdit.RefEdit
Related
The VBA documentation suggests that BoundValue is a valid Control property for a MultiPage control, but doesn't mention whether it is valid for a TabStrip control.
When I try to use Debug.Print Me.MultiPage1.BoundValue or Debug.Print Me.TabStrip1.BoundValue (even if I explicitly set the focus to the control first), then VBA throws error 450 - Wrong number of arguments or invalid property assignment. That suggests that I'm calling the member incorrectly, or there's some contextual requirement for it to return. But I can't seem to find any state in which the property is readable.
Is the documentation incorrect (shock, horror!!!)? Is it possible to read the BoundValue property of a MultiPage or TabStrip? Are there any special conditions for it being readable?
Huh, I assigned Me.MultiPage and Me.TabStrip1 to variables of type Control and inspected the BoundValue in the Locals window.
The MultiPage BoundValue property returns the complete Pages collection, and the TabStrip BoundValue property returns the complete Tabs collection. For a MultiPage control, that's at odds with the documentation, and while the control's Value property returns a Long signifying the currently selected Page, having BoundValue return the complete Pages collection doesn't really tell me anything useful.
I guess I now know that BoundValue does return something, but I don't know if what it returns is useful.
I'm currently learning MATLAB's GUIDE gui programming. I notice that when I place some objects in a figure, a corresponding 'CreateFcn' callback function is creating in the associated .m file. MATLAB's comments state that this function is executed when the object is created (I would consider this a constructor for the object).
However, I've noticed that not all objects seem to have this 'CreateFcn' constructor. Static text objects do not appear to have this callback function. And as of currently, it seems like this function just makes the code more difficult to read. Thus I'm curious if I can delete.
By deleting it, I tend to get an error in my code stating that the function can't be found. So my question: is it possible to delete the 'CreateFcn' method to declutter my code?
Thanks,
Surely it is possible.
Double-click the object to open up the inspector window, locate the "CreateFcn" property and set its value to an empty string. Then go to the .m file and remove the code of CreateFcn. This way MATLAB wouldn't complain about the missing CreateFcn anymore.
CreateFcn is not really a constructor per se, since it happens after all properties of the object are already set. It is more like an optional post-constructor event that gives user an opportunity to further customize the object's initial behavior dynamically. For example, you can customize the object's color at creation depending on the background color on which the object appears. For most control objects, the default behavior is probably already good enough for you. So you can safely remove those CreateFcns until you find a good excuse to use one.
1) Goto the View --> Property Inspector
2) expand the Creation and deletion control, remove the text from CreateFcn and DeleteFcn 3) close the property inspector save the respective GUI (Don't forget to save)
4) remove the callbacks in m-script.
When I define Breakpoint in Eclipse I can inspect variables's values by hovering mouse over it. Also I can switch to Debug perspective and perform more advanced tasks, like writing custom expressions and change value of variables.
I'd like to know if is it possible to perform some of these task in window which opened when I hovering mouse over variable? For example to write custom expression to translate Java Calendars object's value to human readable format on the fly, etc.
Thank you!
You can define a custom formatter that overrides the default toString() implementation of a type in Window->Preferences->Java->Debug->Detail Formatters:
I use (current-window-configuration) to save the size, layout etc of windows, and (set-window-configuration ...) to restore them, so that I can toggle between several window setups. However (current-window-configuration) also saves the current point in buffers, and I would like to only save the window sizes and which buffers they hold. I have tried two different ways to make this happen:
According to the function help of current-window-configuration, the variable window-persistent-parameters controls whats get saved. So now I only need a list of the available window-parameters. But when I look at this variable it's value is ((clone-of . t)), and I can't find a list of the available window parameters online.
I also tried looking at the object returned by current-window-configuration. It is a window configuration object, and gets printed as #<window-configuration>. Is there a way to get into this object, see whats inside and change stuff?
The parameters for window-persistent-parameters may be found in this manual page, though it does not seem to help with your question. A different set of parameters may be found by running (window-state-get nil).
The functions that deal with objects returned by (current-window-configuration) are listed here, but it also mentions:
Other primitives to look inside of window configurations would make sense, but are not implemented because we did not need them. See the file winner.el for some more operations on windows configurations.
At any rate, all these look like really low level stuff, so you might be better off just using winner.el rather than a custom made solution.
Is there a way to find complete class info of an object in Lazarus. F1 doesn't work.
For example, I want to know the methods, events and properties of TSQLQuery. More specifically, I'm trying to find what constants I can use with the state property.
The docs I've found so far aren't really much help in this context.
I've also tried the menu that says 'object browser' but it simply points to the properites window.
TSQLQuery and its unit sqldb is not documented.
The state property however is from the base tdataset ancestor of sqlquery, and that IS documented.
Try typing TDatasetstate or tdataset and press F1
The best documentation is the source code. After you dropped a TSQLQuery on the form CTRL-click on the identifier "TSQLQuery" in the source editor. Lazarus will open the corresponding source file at the position where TSQLQuery is declared. Scroll down to the public methods or published properties to see everything you need. Identifiers usually are self-explanatory - the chm file often does not contain more info. And the source is always up-to-date.
You can do the same with any identifier. Depending on the Lazarus version you may land in the implementation part of the unit. In this case, just press SHIFT-CTRL Up/Down to go to the interface.