1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-15 11:59:34 +00:00
Commit graph

50 commits

Author SHA1 Message Date
FellippeHeitor
514cfbd91d Removed __UI_ from key constants and methods. Also:
- Add an Open "dialog" to the editor: a hidden frame with file browsing capabilities to load a form. Code taken from ide_methods.bas (QB64)
- Add a New option to File menu.
- Remove custom icon from the preview so that QB64's default icon is shown unless an icon file is specified.
- Detect if a control name matches QB64's keywords (not allowed).
2016-12-09 12:27:35 -02:00
FellippeHeitor
8a5b943f63 Improved detection of edits to loaded forms. Also:
- Make control IDs more user friendly by encapsulating them in an easily recognizable variable.
- Trigger __UI_TextChanged with backspace and delete as well.
- Indicate in the title bar that a form was edited (*).
- Only show confirmation at exit if form was edited.
- If the preview app is launched by the user, a new messagebox informs that the main app must be launched.
2016-12-07 11:42:10 -02:00
FellippeHeitor
c756445186 Remove __UI_ from some key arrays' names for external access. Also:
- $SCREENHIDE until the form is defined.
- Set _ICON even if no icon was set, so that at least the QB64 is brought in.
- Minimizing the editor will also minimize the preview (Windows only).
- Fix position of menu separators.
2016-12-06 22:30:47 -02:00
FellippeHeitor
75b68f9f1c xp.uitheme: Replace falcon's uspacing& with uheight& (aligning). Also:
- Make hotkeys always visible in Design Mode.
- Add a call to __UI_MakeHardwareImage for frames (fixes a bug that wouldn't show resize handles for frames or its contained controls).
- Show "Add new" in the menu bar and in menu panels if in Design Mode.
2016-12-05 11:03:24 -02:00
FellippeHeitor
12dfea5ea1 UiEditorPreview: AutoNameControls (AdaptName$()). Also:
- Allow only one menu bar control to be right-aligned.
- Automatically inform the editor that a context menu can't be shown (too small a form).
2016-12-05 11:01:20 -02:00
FellippeHeitor
fd3a270fe3 UiEditor: New AutoNameControls feature. Also:
- New Align menu, for when the preview window is too small to display the contextual menu.
- The Align menu is automatically opened when the user right clicks the Preview Window, if it's too small.
- Less calls to __UI_GetID inside event procedures.
- A message box now asks user if the current form should be saved upon exiting.
- Display the project's name in the Title bar.
- Display the container's font if a control with the same font is selected.
- Properly enable/disable options when menu bar/menu items are selected.
- First property shown is now Caption, as the new AutoNameControl feature will automatically rename based on captions.
- New event: __UI_TextChanged (for textboxes).
- Color Mixer textboxes are now editable (they were editable before but they didn't trigger a change in the sliders' values).
- $RESIZE is saved within the .frm file, if CanResize is enabled.
- Padding is now properly saved for controls that have it set.
2016-12-05 10:59:23 -02:00
FellippeHeitor
b02bc14c2d InForm.ui: Move the $RESIZE metacommand into .frm files. Also:
- Communicate to the preview app that a context menu doesn't fit the current window.
- Receive from the preview app Align commands.
- Add option to Align centers, vertically and horizontally, to Design Mode.
- Bypass screen redraw if Window is minimized.
- Properly recalculate menu bar's height.
- Properly recalculate tooltip's height.
- Properly recalculate menu panel's height.
- Properly align text inside controls.
- Allow hotkeys to invoke contextual menu items in Design Mode.
- Fix centering of controls inside frames.
- Restore and keep aspect ratio of picture boxes when resizing by the corners.
- Bypass contained controls when selecting with drag-to-select.
- Auto-set Stretch property for new PictureBox controls.
2016-12-05 10:52:47 -02:00
FellippeHeitor
f30982b92c xp.uitheme: Show "Add new" for Menu "Bar" and "Item" controls (DesignMode). 2016-11-27 18:29:11 -02:00
FellippeHeitor
2ec4a957f1 UiEditorPreview: Constanly inform the editor that a menu is active. Also:
- Accept "new menu bar" and "new menu item" commands.
- Automatically adapt menu bar when form colors are changed.
- Automatically adapt menu bar when form font is changed.
2016-11-27 18:27:51 -02:00
FellippeHeitor
c1f0eb5770 UiEditor: Insert menu. 2016-11-27 18:26:12 -02:00
FellippeHeitor
62e3c47b4e InForm.ui: Menus (bar and items) can be added. Also:
- Fix font height for _FONT 8 and _FONT 16.
- Control names can now have only up to 40 characters to prepare for "Control.Property" syntax.
- Default font set to SegoeUI (editor and preview).
- Improved design mode context menu (Distribute Vertically/Horizontally).
- When designated .TTF font can't be found, new default is _FONT 8.
- Improved ControlName search to avoid duplicated names (__UI_NewControl).
- Trim controls' captions if CHR$(0) is found.
2016-11-27 18:25:29 -02:00
FellippeHeitor
a91c32c8b1 Fixes and improvements to UiEditorPreview:
- Segoe UI is now used as default font for new forms.
- Fix: preview window now properly reloads if inadvertenly closed.
- Internal contextual menus are not saved any longer.
2016-11-21 23:20:13 -02:00
FellippeHeitor
abcdebbf73 Fixes and improvements to UiEditor:
- Fix: saving a form now properly saves controls' captions.
- New event: __UI_BeforeInit
2016-11-21 23:17:53 -02:00
FellippeHeitor
ac858a5de5 Fixes and improvements to xp.uitheme:
- Single-line textboxes can now use variable width fonts.
- Adds images for future implementation of horizontal scrollbars.
2016-11-21 23:16:14 -02:00
FellippeHeitor
101590d650 Fixes and improvements to InForm.ui:
- Design mode now has a contextual menu for alignment and clipboard operations.
- Fix: Menu bar items can't be invoked by hovering if a context menu is active.
- Selection rectangle for Design Mode.
- New Event: __UI_BeforeInit
- Fix: Crash after last control is deleted in Design Mode - limits the use of hardware images.
- Single line textboxes can now use non-fixedwidth fonts.
- ESC unselects all controls (design mode)
- Pasting the same control over and over positions the new instance in a different spot.
- New controls are created after all controls in the array; empty slots will occur, but it fixes incorrect creation of new controls.
- New listbox method: __UI_GetListBoxItem$
- Fix: selecting a listbox item by typing its name now properly triggers __UI_ValueChanged event.
2016-11-21 23:14:20 -02:00
FellippeHeitor
b9bebbee59 Overall: Replaces QB64's _PRINTSTRING with *uprint* aka falcon.h. Also:
- Adds padding (left/right) to labels.
- Adds multiline support for textboxes.
- Improves wordwrapping for labels - bypasses the function if the same text passed has already been processed for the same width and _font conditions.
- Restores internal textfield contextual menu.
- Textfield contextual menu limits options based on clipboard/selection status.
- Creates a new helpercanvas automatically upon creating a new picturebox control.
- New ReplaceText function which enables \n for adding items to a listbox at design time.

UiEditor.bas:
- Indicator on textbox shows if current input value has been accepted by the Preview renderer.
- Improves saving of nested controls.
- New "icon" property for the main form.

UiEditorPreview.bas:
- Loads the icon specified in the editor and shows it in real time (.ico files encoded as bmps and pngs accepted).
2016-11-02 01:03:46 -02:00
FellippeHeitor
4188be2a76 File loading/saving routines implemented. Also:
- New list box method: __UI_ReplaceListBoxItem.
- Menu items can have icons.
2016-10-22 10:09:59 -02:00
FellippeHeitor
7a3dc578dc Add separators to menus. Also:
- Fix the bug the didn't allow controls placed in frames to be selectable when they had been created before the frame.
- Add "\#" automatically to ProgressBar's caption, so Show Percentage will work.
2016-10-21 01:02:45 -02:00
FellippeHeitor
f5ce607970 Auto-select text upon entering a textbox. 2016-10-20 23:34:36 -02:00
FellippeHeitor
bc1cd37c41 Clipboard operations with controls in design mode. Also:
- Allow preview to be detached from the editor window.
- Checked items in menus.
- Show message while compiling the Preview component.
- New controls are placed inside the selected frame.
- Fixed selecting text when textbox is inside a frame.
- Fix detection of Preview window and the relaunch routine.
- Make frames always be redrawn in DesignMode.
2016-10-20 22:49:10 -02:00
FellippeHeitor
e3a27a54ae UI.BAS split into InForm.ui and xp.uitheme. Also:
New UiEditor and UiEditorPreview.
2016-10-19 02:16:49 -02:00
FellippeHeitor
1cbc8830af Add context menus, tooltips and a slider control. Also:
- Context menu for textboxes will be embeded automatically, though the user may replace it with a custom control.
- Fix MessageBox incorrectly mixing title and message.
- MessageBox uses main form's title if no title is provided.
- New event __UI_ValueChanged.
- Focus outline (dotted line around control) is only shown if keyboard input is received.
- Adds NotoMono-Regular.ttf (licensed under the SIL Open Font License)
2016-10-13 21:11:35 -03:00
FellippeHeitor
3e595972d9 Theme images are now all embeded into the .bas source. Also:
- Fix save routine to properly save the .Stretch property of controls.
- Fine adjustments to ProgressBar drawing.
- Find adjustments to ListBox/Scrollbar drawing.
2016-10-12 23:29:09 -03:00
FellippeHeitor
9daf8a6e2c New controls without name take default Control# name pattern.
Create a new button and it'll be automatically named Button1. Also:

- All existing controls are properly destroyed when loading a saved form.
- Fix hovering to select that stopped working for dropdown lists.
- List or Dropdown list controls have their __UI_Caption set based on the selected item, if any.
2016-10-12 19:57:14 -03:00
FellippeHeitor
75b2616e1b Fix proper indication of __UI_DefaultButton. Also:
- Fix focus outline (dotted line indicator) when _FONT 16 is used.
- Adds a microdelay before showing a MessageBox so the interface can be properly redrawn.
- Fixes __UI_NewControl so that no control can be created without a name or type indication.
- Destroy menu panels before activating menu items, so that the event will be fired only after menu is closed.
- Fix save form routine so that no temporary menu panels are saved.
2016-10-12 16:54:22 -03:00
FellippeHeitor
566ebdae75 Fixed unintended clicks when __UI_DoEvents is called in a loop. 2016-10-11 12:09:13 -03:00
FellippeHeitor
0c3e99b977 Refinements to menu control. Also:
- Basic save/load form functionality (still a bit buggy).
2016-10-11 07:43:07 -03:00
FellippeHeitor
a02b129767 New control: Picture box (read more:)
Can be used to display a picture on a form. Also:

- Theme images can now be embeded in the code, removing the need for external image files (check the icon that shows when the image assigned to the picture box cannot be found).
- Menu items now respond properly to hotkeys.
- Improved menu hover behavior.
- More parameters can be passed to __UI_NewControl (Top, Left)
2016-10-09 15:00:25 -03:00
FellippeHeitor
3e151a305f Working menu system.
Every menu item is a control in __UI_Controls. Needs visual polishing. Functionality is implemented (except keyboard). Also:

- New TIMER approach for DoEvents.
2016-10-08 22:04:28 -03:00
FellippeHeitor
5aad4e3790 Every menu item is now an independent control.
The shift in paradigm allows for more flexibility. Also:
- Improvements to dragging the scrollbar thumb.
2016-10-08 16:42:42 -03:00
FellippeHeitor
268b4ffae3 - Implements hotkeys (Alt+Letter). Also:
- Menus are now accessible using Alt.
- More default settings are automatically defined upon control creation.
- Dropdown now lists have hover to select behavior.
- Alt+ASCII CODE inserts extended characters.
2016-10-08 09:43:03 -03:00
FellippeHeitor
2de37eb062 Minor adjustments to TextBox control rendering. 2016-10-07 20:56:12 -03:00
FellippeHeitor
92f0e8ee61 New control: MenuBar. Also:
- Improved theming engine (control image placement).
2016-10-07 20:52:12 -03:00
FellippeHeitor
8f482f98af New theme: XP. Also:
- Font set for the main form is inherited by new controls.
- All control images are now converted to hardware images.
- Replaced "Enabled" with "Disabled" for control properties (new control properties always default to __UI_False)
- Removed calls to _MOUSESHOW in Linux, for increased stability.
2016-10-06 07:18:16 -03:00
FellippeHeitor
922399be93 New __UI_KeyPress event. Also:
- Rewritten drawing routines: every control is now contained in a separate image, so that it only gets redrawn when needed.
2016-10-04 03:53:22 -03:00
FellippeHeitor
7a45de0418 Add Dropdown lists. Also:
- Exposes MessageBox from libqb.cpp (QB64's internal declaration/implementation; uses Windows API or an emulated alternative under Linux/macOS)
- Scrollbar accepts clicks on the "track".
- Adds a __UI_DoEvents routine that is triggered in the main loop and can also be added to user loops, in order to allow events to keep being triggered.
- Visuall indicates that something is hogging the input routine (when programmer has a DO: LOOP and forgets the add __UI_DoEvents)
- ListBoxes can be searched by typing item names.
2016-10-02 00:54:57 -03:00
FellippeHeitor
422f85ebac Fixed scrollbar thumb dragging behavior. 2016-10-02 00:48:56 -03:00
FellippeHeitor
9941f19607 Hover detection moved to ProcessInput sub. Also:
- Improved response to scrollbar buttons.
- Independent scrollbars removed.
2016-10-02 00:47:57 -03:00
FellippeHeitor
2358b9217b Improved behavior of controls. 2016-10-02 00:45:01 -03:00
FellippeHeitor
cbe1f1d4a5 Add vertical scrollbar to ListBox when needed. Also:
- Independent vertical scrollbar.
2016-10-02 00:44:08 -03:00
FellippeHeitor
e59858fb92 Fixed lag when text longer than label width is displayed (ClipText$) 2016-10-02 00:42:31 -03:00
FellippeHeitor
a19eabbb50 Attempt to reduce lag when text is selected. Also:
- New "text" mouse icon for textboxes.
2016-10-02 00:41:45 -03:00
FellippeHeitor
e151df8d26 Containers are drawn in a separate image (allows clipping). Also:
- Right click to delete listbox items (for testing the delete routine)
- Improved progressbar drawing.
2016-10-02 00:40:46 -03:00
FellippeHeitor
89ad8b1efa Improved input processing for listboxes. 2016-10-02 00:38:33 -03:00
FellippeHeitor
61cfd8fade New Listbox control. Also:
- New ProgressBar control.
2016-10-02 00:37:41 -03:00
FellippeHeitor
45b013057b Improved text selection (textbox). 2016-10-02 00:36:31 -03:00
FellippeHeitor
80c9f9e9f7 Initial textbox development. Also:
- Frame container.
- Radio buttons.
- Check boxes
- New events (BeforeUpdateDisplay, BeforeUnload, OnLoad, BeginDrag, EndDrag
- __UI_Darken& function (_RGB32 intensity manipulator)
- Improved rounded rectangles.
- Improved event dispatcher routine.
- Improved textbox behavior.
2016-10-02 00:35:40 -03:00
FellippeHeitor
98cc8a1a7b Add CanDrag property to controls. Also:
- Use glutSetCursor to indicate a draggable control.
2016-10-02 00:31:09 -03:00
FellippeHeitor
2ecad85811 Attempt with TTF fonts. 2016-10-02 00:29:24 -03:00
FellippeHeitor
072d8ded04 Basic UI structure. Initial commit. 2016-10-02 00:27:10 -03:00