Lazarus
Programming => LCL => Topic started by: bpranoto on February 08, 2016, 04:36:53 pm
-
Is there a DBEdit component with a button?
Pressing the button triggers an event which can be anything up to the programmer like displaying Customer list to choose, a calendar, anything.
I have searched this forum and found http://forum.lazarus.freepascal.org/index.php/topic,26813.msg166397.html#msg166397. The description of the proposed TDBEditButton is exactly what I need. Unfortunately, I can't find it at the Rx packages downloaded from the svn
Thanks.
-
Did you mean TDBEdit with an ellipsis button? If I remember correctly IBObjects supports this feature, but it shouldn't be to difficult to implement. Create a new component(TPanel + TDBEdit + TButton), then implement then appropriate events.
-
There is already TEditButton in EditBtn unit.
So what we need is data-aware TEditButton (TDBEditButton which should be added into DBExtCtrls)
It does not exists ATM, but it is not so big problem to create them.
-
Okay, thanks.
-
Thanks to GetMem, I wrote the component: TF1DBEditButton.
It is a combination of a Panel, DBEdit , and BitBtn. The important properties are:
1. OnButtonClick event: do what ever you like when the user click the button
2. Glyph: to set the button glyph
3. ButtonWidth: width of the button
Files attached are the component package and a small demo project.
-
@bpranoto
Thanks for sharing your work! I'm sure many people will find it useful. Did you test it under the following widgetsets: win32/win64/gt2/qt/carbon?
-
not yet, I currently only use qt under linux.
This simple component still needs improvements, for instance I just add DirectInput:Boolean property which can prevent the user to modify the the text content directly.
Thanks for your pointer for combining the 3 components.
-
This simple component still needs improvements, for instance I just add DirectInput:Boolean property which can prevent the user to modify the the text content directly.
Feel free to improve it. I can test it later under win32/win64/gtk2/carbon.
Thanks for your pointer for combining the 3 components.
You're welcome!
-
Here is a new revision with new properties:
DirectInput:Boolean, if false user cannot modify the text directly
ButtonShortcut: TShortCut, enabling to invoke the button without mouse. Useful for keyboard savvy users.
-
Thanks a lot for the component, my friend, it was a brilliant idea, I incorporated it into the components I use, adding the ability to change the colors of the background and text as I enter and exit the focus, I added them to my repository: https://bitbucket.org/redid_software/componentespub/src/master/
Thank you very much
-
Thanks a lot for the component, my friend, it was a brilliant idea, I incorporated it into the components I use, adding the ability to change the colors of the background and text as I enter and exit the focus, I added them to my repository: https://bitbucket.org/redid_software/componentespub/src/master/
Thank you very much
You're welcome!