summaryrefslogtreecommitdiff
path: root/src/corelib/fpg_widget.pas
AgeCommit message (Collapse)Author
2013-06-07Introduced a new OnKeyChar event for TfpgWidgetGraeme Geldenhuys
2013-05-13Adds a new convenience function IsLoading to TfpgWidgetGraeme Geldenhuys
2013-05-03Only call DocView if fpgApplication.HelpFile is set.Graeme Geldenhuys
2013-04-08Menu shortcuts with F1 key combinations never worked.Graeme Geldenhuys
The global F1 (application help) shortcut handling never looked at the ShiftState value. So if we had a popup menu with F1->help; Ctrl+F1->About, the second item's shortcut with be interpreted as F1 only.
2012-11-09Moved Menu-key press handling up the class hierarchy to TfpgWidget.Graeme Geldenhuys
No need for so much code duplication. This also means that widgets like TfpgStringGrid now have keyMenu keypress behaviour. Basically any widget that supports a PopupMenu.
2012-08-28TfpgWidget: Implements a new OnMouseScroll eventGraeme Geldenhuys
2012-08-16F1 is not hard-coded as the help key any more.Graeme Geldenhuys
fpgApplication.HelpKey is now actually used in fpGUI, and it will invoke the help.
2012-07-17TfpgWidget now consumes the F1 keypress to invoke context sensitive help.Graeme Geldenhuys
2012-07-17Extra debug output added to TfpgWidget.HandleAlignmentsGraeme Geldenhuys
2011-12-06Hide the hint window when the mouse button is pressed.Graeme Geldenhuys
2011-08-24added begin..end block to make code more readable.Graeme Geldenhuys
2011-08-24bugfix: Menu key never set consumed = True in key press processingGraeme Geldenhuys
2011-08-24reworked TfpgWidget.MsgKeyPress() to correctly handle keyboard shortcuts.Graeme Geldenhuys
processing order is now as follows; - widget that keypress occured it trys to handle the event. - then to keyboard shortcut processing for the widget's children - then work back towards the top-level form giving chance for keyboard navigation (tabstop) processing. eg: pressing Tab key - then let the top level form to keyboard shortcut processing eg: allowing MainMenu to process the event. - then allow the top level for to process OnKeyPress if such an event handler is implemented. - then if the top level form is not the MainForm, and the current top level form is not shown model, allow the application.mainform to process the keyshortcut in it's main menu.
2011-08-24Introduced DoKeyShortcut() into TfpgWidgetGraeme Geldenhuys
This is similar to HandleKeyPress() but takes into account the original widget that started the process, so it doesn't process that widget or its children twice.
2011-05-19better debug output when needed.Graeme Geldenhuys
2011-05-19This code is not needed any more, as it was meant for FPC 2.2.x versions.Graeme Geldenhuys
Code cleanup was done. After all, FPC 2.4.0 and 2.4.2 has been out for ages.
2011-04-05Fixes a potential AV when ActiveWidget is freedGraeme Geldenhuys
If the ActiveWidget was freed, the parent never got notified. If focus was then changed, the parent tried to call ActiveWidget.HandleFocusKill, causing an access violation. The toolkit now correctly sets ActiveWidget to nil if it was freed, and as a extra failsafe, wraps the HandleFocusKill call in a try..except block.
2011-03-26Set the default value for IgnoreDblClick propertyGraeme Geldenhuys
2011-01-20adds extra checks to know when we shouldn't fire the OnClick eventGraeme Geldenhuys
2011-01-19OnClick now only triggers if the LeftMouseUp occurs in the bounds of the widget.Graeme Geldenhuys
Old behaviour was that the OnClick will trigger even if the left mouse button was released outside the bounds. This is not standard behaviour compared to other gui toolkits.
2011-01-12UpdateWindowPosition now called irrespectively in MoveandResize.Graeme Geldenhuys
Because widget positioning is new possible before it is show, we need to call UpdateWindowPosition any time we set Width, Height, Top or Left so that it can update the internal state of the widget correctly.
2011-01-11fixes Alignment and Anchor calculation even before we have a window handleGraeme Geldenhuys
Updated the following methods by rather checking the ComponentState, than the HasHandle result. Why? Because we want alignment and anchor calculations to work, even before we have a window handle. Something that happens often when using a Frame-type design for the UI. * HandleMove() * HandleResize() * UpdateWindowPosition() Due to removing the HasHandle check in UpdateWindowPosition, we had to do the HasHandle check in each backend code instead. We don't want to trigger API calls when we don't have a window handle yet.
2010-12-30TfpgWidget.MsgResize never considered constraints when calculating size deltasGraeme Geldenhuys
Old behaviour calculated the size deltas, then applied the new sizes from the received message. The new sizes were not guaranteed due to widget size constraints that could be applied, which means the deltas could be wrong, which in turn meant child components could be positioned incorrectly. We now store the original size values in temp variables, apply the new sizes which handles possible constraints, then only do we calculate the deltas, and then pass those on to HandleAlignments().
2010-11-18TfpgWidget.SetAlign called the wrong ReAlign() method.Graeme Geldenhuys
Not calling Parent.Realign ment we (self widget) is not being resized (excluded from the re-align calculation), and thus the self widget status at its current location and dimentions - until the end-user actually resizes the top-level form. This has now been fixed. NOTE: If you create extra widgets (eg: frames) outside the control of the UI Designer, but still created before resource handles are created, and you use Align property in those widgets, you need to rather create those in Form.OnShow(). Align changes are not always acted apon before they have a window handle, so it's best to do it in Form.OnShow for example. I'm still figuring out how best to handle this.
2010-11-12Extra check in SetPosition, so we don't trigger it needlessly.Graeme Geldenhuys
2010-11-12Added "call stack debugging" for internal use.Graeme Geldenhuys
It's disabled by default. Enabling can be done via project level or inside each unit at the beginning of such units.
2010-11-09* Added property IgnoreDblClicks to TfpgWidgetAndrew Haines
* TfpgButton now ignores double clicks by default
2010-10-29Published the DND propertys for some of the most used components.Graeme Geldenhuys
This is so they can be tested. Once DND stabilizes, I'll make the properties available on the other components too.
2010-10-29Moved OnDragStartDetected from TfpgWidget to TfpgWindowBaseGraeme Geldenhuys
* also introduced virtual DoDragStartDetected which executes the OnDragStartDetected event * We also added a override of DoDragStartDetected in GDI for some extra tasks.
2010-10-28TfpgWindowBase introduced a new abstract methodGraeme Geldenhuys
* This abstract method is called from TfpgWidget's AcceptDrops setter function * Template implementation in X11 * Actual implementation in GDI
2010-10-25Improved event firing of OnDoubleClick and OnClickGraeme Geldenhuys
* Single click produces one OnClick event * On a Double Click in produces a OnClick, then a OnDoubleClick event. Old behaviour used to procuder yet another OnClick at the end. This is not needed. * OnMouseDown and OnMouseUp events behaviour has not changed. The reason we introduce the FOnClickPending instead of fully handling the events in TfpgWidget.MsgMouseUp is because a TfpgButton has slightly different behavior (eg: When clicking on a button, keep mouse down, and move mouse out of button rectangle, then an OnClick must not fire.) The extra FOnClickPending allows us to toggle this behaviour of HandleLButtonUp (which normally fires the OnClick event)
2010-10-15TfpgMemo now has BeginUpdate and EndUpdate methodsGraeme Geldenhuys
This allows you to add/delete many lines and the memo only repaints once.
2010-10-12minor code formattingGraeme Geldenhuys
2010-10-04Reworked algorythm for Align propertyGraeme Geldenhuys
* It used to have a hard-coded processing of alignment. Top, Bottom, Left, Right and then Client. * This meant extra "fake" panels was required to get a specific design. * Align property is now processed in the creation order of the widgets.
2010-10-04Anchors now support relative positioningGraeme Geldenhuys
If you only set a single anchor eg [anTop] and you resize the width of the form, the component will stay relative to the original position. if you place a component in the center of a form, and set anchors to [], and resize the form, the component will stay centered.
2010-09-25TfpgWidget: adds support for new event, OnDragStartDetectedGraeme Geldenhuys
2010-09-23X11 DND: a variant is now passed around and used in OnDragDrop event.Graeme Geldenhuys
2010-09-23Adds OnDragDrop event to TfpgWidget.Graeme Geldenhuys
For now we hard-code the data type as TfpgString. Later this will change.
2010-09-23Adds OnDragExit event to TfpgWidget.Graeme Geldenhuys
2010-09-23Catch the OS independent DROP[Enter|Exit] messagesGraeme Geldenhuys
Under X11 the XDND OS messages on only go to the top-level window, so we send the FPGM_ messages ourselves. Later each component will hook into this to change it's appearance to show the end-user that a drop is allowed or not. eg: Some components will get a dark/black border or something.
2010-09-23Adds OnDragEnter event for TfpgWidget.Graeme Geldenhuys
2010-09-23Adds new boolean property AcceptDrops to TfpgWidget.Graeme Geldenhuys
This will enable/disable drop support per widget.
2010-09-20KeyPress events is now distributed to Widgets, then Form, then fpgApplicationGraeme Geldenhuys
* KeyPress is first offered to the focused widget * If not consumed, then to parent, then parent.parent etc.. * if still not consumed, then to top level form * if still not consumed, then to fpgApplication If anywhere in the sequence Consumed = True, then distribution of that event is stopped. This is the basic foundation required for various keyboard shortcut handling, actions shortcut handling, and especially in menus. The latter still needs some work though.
2010-09-20Moved GetClientRect() and GetBoundsRect() out of TfpgWidget into TfpgBaseWindowGraeme Geldenhuys
Now these functions are accessible to platform specific code too.
2010-08-10Alignment bugfix: TfpgWidget.DoAlign never checked if widget was visible or notGraeme Geldenhuys
If widgets are not visible, they are not added to list of widgets that need to be re-aligned.
2010-06-28Simple code formatting fixGraeme Geldenhuys
2010-04-29Fixed code to remove compiler warnings/hints.Graeme Geldenhuys
2010-04-25minor change to TfpgWidget.Graeme Geldenhuys
2010-04-25Introduced new event for TfpgWidget called OnShowHint.Graeme Geldenhuys
This event will get fired just before a hint is displayed. You can use this this event to adjust the Hint text to make it more dynamic.
2010-04-13Message Dialog buttons now use translated text.Graeme Geldenhuys
Initializing the cMsgDlgBtnText when it was declared is too early and the translated strings have not yet been loaded. We we update the array a bit later to make sure it is correct.