summaryrefslogtreecommitdiff
path: root/src/corelib/fpg_widget.pas
AgeCommit message (Collapse)Author
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.
2010-03-18Setting MouseCursor at design time now works correctly under X11.Graeme Geldenhuys
2010-03-16Fixed visibility handling of components created at runtime.Graeme Geldenhuys
We used to force all components to Visible = False, and iterated this to child components. Now all components default to Visible = True (just like the global default), and hiding child components, you only need to hide the parent (visible = False) - no iteration needed.
2010-03-15Revert a old changes in TfpgWidget.HandleShow.Graeme Geldenhuys
At startup, components should be correctly handled according to their .Visible property.
2010-02-26Update copyright notice in all units.Graeme Geldenhuys
2009-12-10When forms are embedded, don't show popup-menu components when the rest are ↵Graeme Geldenhuys
shown. * I don't like the implementation dependency on fpg_menu though. I'll try and see if there is some better way of doing this.
2009-11-05More support for a help systemGraeme Geldenhuys
* Implemented InvokeHelp in TfpgWidget * implemented InvokeHelp and OnHelp event in TfpgForm * Implemented HelpConext, HelpKeyword and HelpType in TfpgComponent
2009-10-26Minor fixes to properties in fpg_spinedit unit.Graeme Geldenhuys
Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
2009-10-26Implement a setter method for FormDesigner propertyGraeme Geldenhuys
* Also replaced various FFormDesigner checks with InDesigner method. Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
2009-10-09New InDesigner method for TfpgWidget.Graeme Geldenhuys
It's just a handy function instead of FormDesigner <> nil etc... Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
2009-06-08Fixed the keyMenu handling in BasicEdit components.Graeme Geldenhuys
2009-04-07Added support for changing the tabs in the PageControl whileGraeme Geldenhuys
in the Form Designer. It's not perfect, but workable. ;-)
2009-02-10* SetEnabled recursively sets enabled property.graemeg
2008-09-27* Phase 2 of the unit rename is complete. The gui units have now been renamed.graemeg
* UI Designer has been updated to reflect the new gui unit names.
2008-09-27* Rename all corelib units to the new naming convention.graemeg
* Updated the UI Designer to use the new unit names.