| 1 | Bugs: |
|---|
| 2 | - RadioGroup has cell sizing problems. The cell size is the same as posSize[2] |
|---|
| 3 | and this causes problems when a negative value is used for the width. It would be |
|---|
| 4 | possible to get around this by getting the width of the NSMatrix from .frame() |
|---|
| 5 | but since the cell sizing occurs during RadioGroup.__init__, this won't work. |
|---|
| 6 | During __init__, the matrix has not been assigned to a superview, and it is |
|---|
| 7 | during superview assignment that the matrix is sized, soooo the matrix has a width |
|---|
| 8 | of 0 during __init__ which doesn't help out. One possible solution is to set |
|---|
| 9 | matrix.autosizesCells, but that resizes both the width and height of the cells |
|---|
| 10 | which really sucks in vertical radio groups. The other option is to subclass |
|---|
| 11 | NSMatrix and override viewDidMoveToSuperview so that the cell sizing happens |
|---|
| 12 | once the matrix joins a superview and, therefore, has a width. I think this is |
|---|
| 13 | the way to go, but I don't know how a subclass could work with the |
|---|
| 14 | nsSubclasses.getNSSubClass function. |
|---|
| 15 | |
|---|
| 16 | Needed Features: |
|---|
| 17 | - More button styles? TexturedSquareButton, RoundedButton, RoundedImageButton, etc. |
|---|
| 18 | - Image (NSImageView) |
|---|
| 19 | - SegmentedControl |
|---|
| 20 | |
|---|
| 21 | Ideas: |
|---|
| 22 | - All objects should either have a _view attr or a _getView() method, that |
|---|
| 23 | gives us access to the underlying NSView we're wrapping. This may replace |
|---|
| 24 | nsObject. (They have a _getContentView method. Not good enough?) |
|---|
| 25 | (Not really; all our widgets represent an nsView, yet not all our nsObjects |
|---|
| 26 | are views.) |
|---|
| 27 | - Allow for non vanilla NS objects to be assigned to a window. This would |
|---|
| 28 | be very useful in cases such as custom drawing boards. |
|---|
| 29 | This is actually very easy to implement. To do it, all we need to do is |
|---|
| 30 | test for instances of NSView in the _setattr and _delattr functions in |
|---|
| 31 | vanillaBase. I haven't run into a need for this functionality, though. |
|---|
| 32 | - ImageButton should support more features such as alt images and on/off behavior. |
|---|
| 33 | |
|---|
| 34 | Rejected Ideas: |
|---|
| 35 | - use floats to convey that an object should be positioned relative to its |
|---|
| 36 | superview. The only problem is that objects would become fixed after initial |
|---|
| 37 | positioning. This may not be a huge problem... |
|---|
| 38 | - use properties for setting/getting posSize in window and objects. |
|---|
| 39 | (I'm not sure if we should do this. Everything else is handled via methods |
|---|
| 40 | x.getSelection(), x.setItems(...), etc. Why should posSize be different?) |
|---|
| 41 | - how about Window subclasses: ModalDialog |
|---|
| 42 | |
|---|
| 43 | Documentation Needs: |
|---|
| 44 | - List of standard sizes for all controls in all sizes. (Done.) |
|---|
| 45 | - The generated doc is getting to be very long. Once the module has been |
|---|
| 46 | split up into separate files, the doc generator should be reworked. (Done.) |
|---|
| 47 | - Establish some type of syntax for highlighting portions of the doc |
|---|
| 48 | with bold, italic, etc? (Done.) |
|---|
| 49 | - Make doc strings follow PEP 257. (Done. Except for the line length. |
|---|
| 50 | I don't work on Emacs v1.0,) |
|---|
| 51 | |
|---|
| 52 | Done: |
|---|
| 53 | - RadioGroup |
|---|
| 54 | - SquareButton |
|---|
| 55 | - Sheet |
|---|
| 56 | - ProgressSpinner |
|---|
| 57 | - need to have a window delegate. Maybe vanilla. Window should be an NSObject |
|---|
| 58 | subclass, so _it_ can be the delegate |
|---|
| 59 | - need to release cyclic references when a window closes |
|---|
| 60 | - Window's _window should be retained after all, and released on close |
|---|
| 61 | (need to carefully check how/if that works with sheets |
|---|
| 62 | - Drawer |
|---|
| 63 | - Group |
|---|
| 64 | - ColorWell |
|---|
| 65 | - TextEditor needs lots of methods for managing the selection, etc. |
|---|
| 66 | - FloatingWindow |
|---|
| 67 | - TextBox needs an alignment argument "left", "right", "center" |
|---|
| 68 | - we have too many rect representations: |
|---|
| 69 | - posSize: (l, t, w, h), negative values meaning relative to parent frame, |
|---|
| 70 | coords go from top to bottom |
|---|
| 71 | - frame: a Cocoa frame ((x, y), (w, h)), coords go from bottom to top |
|---|
| 72 | - bounds: (l, t, r, b), as in getBounds() and setBounds() |
|---|
| 73 | Maybe we can get rid of the last one? Hm, getPosSize() returns a posSize |
|---|
| 74 | that no longer contains negative values. It's all pretty confusing. |
|---|
| 75 | (I agree. Let's get rid of bounds. As for returning the negative values, |
|---|
| 76 | we could keep the self._posSize that is set during __init__ after |
|---|
| 77 | self._setFrame. That would make it trivial for us to return the exact values |
|---|
| 78 | set for the object, not values derived from the NS objects's frame.) |
|---|
| 79 | - ImageButton |
|---|
| 80 | - ScrollView (What would be a use case for this?) (Anything that needs to scroll?) |
|---|
| 81 | - SplitPanes |
|---|
| 82 | - Multicolumn List. The plan is to have a separate datasource for multicolumn |
|---|
| 83 | tables. This datasource will use getattr(item, column.identifier()) to get the |
|---|
| 84 | proper data. |
|---|
| 85 | - We need to be able to subclass NS objects so that we can implement special behaviors. |
|---|
| 86 | For example, we need keyDown in List, but that must be implemented by a NSTableView |
|---|
| 87 | subclass. (Also see note about RadioGroup sizing problem). The temporary solution to |
|---|
| 88 | this is to copy the attrs from methods from _VanillaMethods in nsSubclasses. This is |
|---|
| 89 | obviously a bad idea. So far this has been done for: List, EditText |
|---|
| 90 | - new window method: window.addToDocument(nsDocument) this will make it |
|---|
| 91 | much, much easier to use vanilla windows as document windows. |
|---|
| 92 | - List: If we want cell editing, we need some sort of support for |
|---|
| 93 | "formatters", so numeric data doesn't turn into strings. |
|---|
| 94 | - The List object needs to be overhauled. Internally it should use Cocoa Bindings. |
|---|
| 95 | The columnTitles argument should be replaced with a columnInfo argument which |
|---|
| 96 | will contain info about each column (title, id, width, cell type). It should |
|---|
| 97 | be possible to put controls into the List. This will require a new line of |
|---|
| 98 | wrapped objects that represent cell types. |
|---|
| 99 | |
|---|
| 100 | Fixed bugs: |
|---|
| 101 | - CheckBox is sometimes causing crashes when selected. |
|---|
| 102 | In the test window, click checkbox 2 to see the crash. |
|---|
| 103 | This was caused by us not handling overwriting an existing widget in |
|---|
| 104 | __setattr__ correctly. It caused the vanilla wrapper to go away, which |
|---|
| 105 | caused the callback wrapper to go away. The nsObject (still alive, as it |
|---|
| 106 | is retained by the superview) has borrowed reference to the callback wrapper, |
|---|
| 107 | which is now gone, so the pointer is stale. Kaboom. |
|---|
| 108 | - RadioGroup seems to be clipping long text. |
|---|
| 109 | - Box title is gray, not black. |
|---|
| 110 | - Autosizing magic is a little buggy. In the test window, text tab, drag the |
|---|
| 111 | window so that the height is above the top of the TextEditor. Then drag |
|---|
| 112 | the height back down. I'm almost certain that this is not a vanilla bug |
|---|
| 113 | as I can duplicate it in InterfaceBuilder. Furthermore, I can't fix the |
|---|
| 114 | behavior in InterfaceBuilder. Tal: you're right, this is not a vanilla |
|---|
| 115 | bug. The workaround is to set the minimum size of the window large enough |
|---|
| 116 | to prevent this from happening. I'm fairly sure this is just how the Cocoa |
|---|
| 117 | geometry works. |
|---|
| 118 | - fixed circular ref leak involving Drawer |
|---|
| 119 | - Window and VanillaBaseObject could share __setattr__ logic. The fact that |
|---|
| 120 | Window is an NSObject and VBO isn't may make this impossible, though. |
|---|
| 121 | - Our buttons have their labels set one pixel higher than IB buttons. It's |
|---|
| 122 | actually a text size issue All default text sizes need to conform to the |
|---|
| 123 | Aqua Human Interface Guidelines (chart found in the Fonts section). |
|---|
| 124 | font = NSFont.systemFontOfSize_(NSFont.systemFontSizeForControlSize_(NSRegularControlSize)) |
|---|
| 125 | control.setFont_(font) |
|---|
| 126 | This is a fairly widespread problem. It appears that TextBox, EditText, |
|---|
| 127 | ComboBox, PopUpButton, Button, SquareButton, RadioGroup, Tabs and Box* |
|---|
| 128 | are all displaying the problem. We can solve this by adding a |
|---|
| 129 | _setDefaultFont method to VanillaBaseObject, but somehow this doesn't |
|---|
| 130 | seem right. The main problem is that not everything that subclasses |
|---|
| 131 | VanillaBaseObject needs to/can have its font size set. |
|---|
| 132 | (setFont_() is a method on NSControl, so if we use VanillaBaseControl |
|---|
| 133 | for all NSControl derived views, we should be fine. Whenever we have a |
|---|
| 134 | sizeStyle keyword arg, we should also use it for TextBox; I think that's |
|---|
| 135 | better than to allow all font settings, better force the user to stay |
|---|
| 136 | consistent with Aqua.) |
|---|
| 137 | Perhaps we need another subclass or two... Fixing the font problem is |
|---|
| 138 | very simple. I just want to make sure I'm being smart about how it is |
|---|
| 139 | done. Hm. *Box uses NSSmallControlSize for the font size |
|---|
| 140 | - support the various sizes for controls? this will be done in the control.__init__. |
|---|
| 141 | it will be a sizeStyle argument that defaults to "regular". other options will be |
|---|
| 142 | "mini" and "small". (see comments about font size problem above) |
|---|
| 143 | - Slider needs a tickPosition argument in __init__ |
|---|
| 144 | No. Cocoa handles the default position just fine. Let's force callers |
|---|
| 145 | to use the setTickMarkPosition method. |
|---|
| 146 | - unbordered ImageButtons look odd when pushed. |
|---|
| 147 | (2 things needed to happen: the images that are used in the button |
|---|
| 148 | need to have declared transparency, either by explicitly saving the tif with |
|---|
| 149 | transparency in PhotoShop or by using a file format that supports transparency |
|---|
| 150 | more easily; the highlightsBy flag needed to be changed on the nsObject.) |
|---|
| 151 | - EditText is not calling the callback continuously. (Though it is set to) |
|---|
| 152 | setContinuous does not seem to apply to NSTextField. So, the solution was to |
|---|
| 153 | subclass NSTextField and use textDidChange to trigger the callback. |
|---|
| 154 | - Many controls have buffers around the image to compensate for shadows, etc. |
|---|
| 155 | This makes it cumbersome to get controls neatly lined up. For example, adding |
|---|
| 156 | an EditText with a left position of 10 and a Button with the same left position |
|---|
| 157 | will cause the controls to appear misaligned. Maybe we could compensate for this |
|---|
| 158 | by internally offsetting the frame of the controls by preset amounts. In other |
|---|
| 159 | words, the scripter would pass a coordinate of 10, we would then switch th |
|---|
| 160 | coordinate to 7 which would make it optically align to 10. Hm. |
|---|
| 161 | - Fix window cascading problem. |
|---|
| 162 | - in the new List, __setitem__ selects the item set in a single column list |
|---|
| 163 | but not in a multi column list. |
|---|
| 164 | - in the new List, editing of single column lists does not work |
|---|
| 165 | - CheckBox, the text in mini and small are out of alignment with the box |
|---|
| 166 | (I [Tal] am stumped. I've done everything I can think of. I've even programmatically |
|---|
| 167 | compared the various attributes set by vanilla to the same attributes set by IB. |
|---|
| 168 | Nothing stands out.) |
|---|
| 169 | - w.bind("<activate>", callback) and friends. |
|---|
| 170 | - The window bindings defined in the code are <foo> but the doc lists them as foo. |
|---|
| 171 | - ProgressBar |
|---|
| 172 | - need to examine the Tabs API. It should have a "select" method for selecting |
|---|
| 173 | a particular tab. |
|---|
| 174 | - key bindings for controls. this should be simple. we just need to figure out |
|---|
| 175 | how the API is going to work. |
|---|
| 176 | |
|---|
| 177 | |
|---|
| 178 | |
|---|
| 179 | W compatibility: |
|---|
| 180 | (This is not a list of *needed* things as many of them are not |
|---|
| 181 | necessary or feasible. this is simply a reference. This also |
|---|
| 182 | exists so that we can anticipate the W could... questions.) |
|---|
| 183 | - Window.__init__ needs tabbable, show, fontsettings |
|---|
| 184 | - TextBox.__init__ needs align, fontsettings, backgroundcolor |
|---|
| 185 | - EditText.__init__ needs inset, fontsettings, tabsettings |
|---|
| 186 | - TextEditor needs wrap, inset, fontsettings, tabsettings |
|---|
| 187 | - HorizontalLine and VerticalLine.__init__ need thickness |
|---|
| 188 | - List.__init__ needs flags, typingcassensitive |
|---|
| 189 | - no BevelButton control |
|---|
| 190 | - no PopupWidget or PopupMenu controls |
|---|
| 191 | - no RadioButton control (RadioGroup is to be used instead) |
|---|
| 192 | - no ScrollBar control (views that require scroll bars get them automatically. |
|---|
| 193 | and the hackers [like me] that used scroll bars as sliders now have Slider.) |
|---|
| 194 | - no Frame class (not sure what Frame did) |
|---|
| 195 | - no BevelBox class |
|---|
| 196 | - no HorizontalPanes or VerticalPanes classes |
|---|
| 197 | - no ColorPicker class |
|---|
| 198 | - no FontMenu class |
|---|
| 199 | - no PyEditor control |
|---|
| 200 | - no Dialog or ModalDialog classes |
|---|