From: Alex T. <al...@tw...> - 2005-07-29 01:33:59
|
The version of the resourceEditor which handles multiple-component operations (and has the single large window to display all properties at the same time), has now been updated and committed to CVS. It's inside the regular tools/resourceEditor directory, called multiresourceEditor.py (all source files needed by it are prefixed with "multi"). Significant changes (from v 0.3a back in May) 0. It's in CVS - easier to try out. 1. No longer needs a modified version of widget.py - much easier to try out. 2. Has better, slightly simpler, auto-naming scheme 3. Includes Select-All and multiple component delete. 4. Layout should be marginally better on Mac / Unix. Feedback sought on everything, but particularly - layout on Mac / Unix: screenshots welcome - naming scheme - is it easy or hard to understand ? to use ? Thanks - brief document describing new features included below. Multiple Component Resource Editor ( was previously Experimental Resource Editor v 0.3a ) This has now been committed to CVS, and can be obtained from there by anyone who is familiar with getting code from CVS. (Go to http://www.pythoncard.org and select CVS from the left menu for info on how to do this) The main changes include are listed below (as a consolidated list, rather than by version as was done before). The biggest change from 0.3 to 0.4 is a revision in the auto-naming rules for components; please see below for details of how the new scheme works. IMPORTANT NOTE: 0.3 and 0.3a required you to update Pythoncard/widget.py This is no longer necessary; the multiresourceEditor runs without any changes in the PythonCard framework. If you have previously installed 0.3 or 0.3a, please be sure to revert to the standard version of widget.py Property editor window display. The propertyEditor Window has been extensively changed. Previously it was a small window, showing a list of components and a list of attributes applicable to the currently selected component. The currently selected attribute was displayed (and editable) below this. The new version uses a much larger window, again showing a list of components. For the currently selected component, ALL attributes are shown, in a large area to the right. Any of the attributes can be edited directly, and the change will take effect as soon as the focus leaves the field being edited (the Update button is still also available). Component naming when created - automatic naming rules When a component is newly created, its name is automatically generated; - if a new component being added, the name is formed by taking the component type name, and appending an integer - the smallest number which provides a new unique name. Thus: Button1, Button2, Button3, ... - if a component is being created by either a copy/paste, or Edit/Duplicate command, then name is based on the existing component, with an integer appended (again, smallest number to produce a new name is used). Thus: if Button1 is being Duplicated, the new component will be Button11, or Button12, or Button13.... If the component has a label or text attribute, this will be automatically generated; it will be the same as the name. By default the name and label (or text) are tied together, and will remain that way. If the name is edited, the label (text)will change to be the same as the name. If the label (text) is edited, the name will change to match it if that is a valid name; if it is not, the label will be mangled by changing all " " (spaces) to "_" (underline), and removing any other non alphanumeric character. If you wish them to NOT be tied together, you must check the "Vary" box to the left of the name field, and then edit either (or both). If the name and label (text) of a component are already non-matching, then the "Vary" box will be checked for you, and you can edit either one independently of the other. You can un-check the Vary box. If the name and label (text) currently match, then the box will be unchecked and the two properties tied together; if they do not currently match, you will be presented with a dialog to allow either changing the label (text) to match the name, or to cancel the un-check attempt. Multiple components. You can select multiple components and perform various operations on them. Clicking on a component selects it (just as before). Ctrl-click will add a component to the selected set, or remove it if it is already in there. The property window can be watched to let you know if you are in "single-component mode" or "multiple-component mode". If you select a number of components, and then deselect all but one of them, you remain in multi-component mode. (NB this feels better to me - but is certainly a candidate for later change if we think we should.) This does save a "flash" back into single mode display, when de-selecting and re-selecting most of a group. If there is NO component selected, and you select the first one by Ctrl-Click, then you enter multi-component mode immediately. The specific reason I did this no longer applies - but I'd got used to it by then. Again, this does save a certain amount of "flashing" between the two modes (and their display). Note that when in multiple-component mode, the component box in the property window is for display only - you cannot click in that box to (de)select components. It shows only those components which are in the selected set. This is mostly because Pythoncard doesn't have a multi-choice list box, but also partly because using a multi-choice list would make it harder to see at a glance which are selected. Once a set of components have been selected, you can mouse-down (i.e. press and hold, no ctrl-key) WITHIN one of the selected components; this will bring up the enclosing rectangle for the whole set, and you can then move them around. They can also be moved using the arrow keys; however, this has always been a bit flaky - sometimes the key events get captured by something else, and used for field-traversal-tabbing. It may be a bit more flaky with the new display panel - see "nudge commands" below for other options. Note that Copy, Cut and Paste *do* work for multiple components. Delete (Ctrl-D) now works in multiple-component mode - thanks to Roberto Rosario for the original patch for this. Note I modified it to bring it up to date for latest CVS - so any errors are mine, not his. Multiple component selection using rectangular "marquee" You can select multiple components by enclosing them within a rectangular "marquee". The basic form involves pressing the mouse button down NOT within any component, and while holding the button down, dragging the mouse out to surround some components. These components will become a new multiple-component selection, replacing any previous selection. You can modify this by using modifier keys while doing the rectangle selection. 1. No modifier - define a new selection 2. shift-rectangle : add enclosed components to existing selection (any enclosed components already selected remain selected) 3. ctrl-rectangle : toggle the status of enclosed components (i.e. if already selected, remove it, if not already selected, add it) 4. shift-ctrl-rectangle : subtract from existing selection Multiple component selection of all components. The menu selection (Edit / Select all), or its equivalent shortcut of Ctrl-A, select all components. Again thanks to Roberto Rosario. Buttons for layer changes. A component can be moved Back/Forward using the main menu Options / Send to Back, etc., or the shortcut keys Ctrl-1, Ctrl-2, etc. However, these keys don't work when focus is in the property window. Buttons have been added (below the component list box) to allow re-layering of a component. As well as the 4 buttons corresponding to the existing commands, there are two additional ones which only take effect when there are multiple components selected. First, a description of what it means to re-layer multiple components. All the selected components are put, in the order they were selected, together in the final order list. The base component (first one selected) is then moved back or forward according to the given command, with all other selected components following it. In some cases, you will want to collect the selected components together in the component ordering, but without changing the base component's place in the order. The first new button "gather together" does this. The second new button takes a set of components and re-layers them according to their position, in approximate "reading" order; top-left to bottom right, in rows. Just like "Gather together", this re-ordered set of components finish up adjacent in the layer ordering, following the place in order of the base component. Beware that the reading order works well if the components are non-overlapping, but can be hard to predict when there are multiple overlapping components selected (e.g. if you were to edit the resource editor's own resource file, where the "single-mode" and "multiple-mode" controls occupy the same area, and simply select all of them, you will get a different result from what you expect or want. This is a result of the comparison function used to sort into "reading order" - if one component is entirely below another, the order is clear; otherwise they are assumed to be on the same row, and sorted according to X coord. NB There is a definite lack of visual feedback from these commands. I'm trying to find a good way to give this feedback - any suggestions gratefully received. These command will probably go on the menu eventually. Arrow keys & Buttons to 'nudge' components. The arrow keys can be used to reposition a component, as before. However, they now have the added feature that - Ctrl-arrow will move in that direction by the currently specified grid step, and align to the grid even if the "Align to grid" option is not enabled. - Shift-arrow will move by the grid step distance, but without rounding to the grid - Shift-Ctrl-arrow will move by the square of the grid size (and round to the basic grid). Good accelerator for big moves - beware you can jump right off the window if you're not careful. As mentioned above, occasionally (or perhaps often), one or more of the placed components gets in the way of key events ['buttons start tabbing, calendar starts moving the selected date, etc.]. Therefore there are now button on the property window to move the selected component or components. these are in the box labelled "NUDGE" at the bottom-left. Clicking on each arrow button here moves the component in the obvious direction. The number inside these buttons controls how far the components are moved; 1 moves by 1 pixel, 2 by a grid-step, 4 by the square of a grid-step. (3 is the same as 2 for now). These moves always honour the Align to Grid setting. [NB - this may change - either to be simply pixel distance, or a drop-down choice for the 1 vs grid vs grid*grid to allow all the choices available by the arrow keys.] Various operations are enabled when in multi-component mode. Remember that the *order* the components were selected (visible by order they are listed in the component box) is significant for many of these. Align operations. The box labelled "ALIGN" contains six buttons, which align the components up with the first selected on. They can be aligned by left side, right side, top, bottom (four buttons grouped to the left). Or the centres of the components can be aligned, either vertically or horizontally (i.e. into a column or into a row). Distribute operations. The box labelled "DISTRIBUTE" has four buttons; two on the left for distributing horizontally and two on the right for vertical distribution. The top button on each side distributes the components "edge-to-edge"; i.e. the first component does not move, the second one is placed to the left (or below) such that the edges line up, then the third, etc. The lower button distributes them with even-sized gaps from "first-to-last"; i.e. the first and last components do not move, the others are distributed between them such that the gaps between the edges are equal sized (or as close as possible). Note that if the components add up to larger than the total distance between first and last, then they will overlap (i.e. the 'gap' can be negative), but it will still be evenly shared between them. Equalize operations. The box labelled "EQUALIZE" has three buttons, which set the width (the height, or both) of all other components selected to match the first component. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.9.6/59 - Release Date: 27/07/2005 |