Recent

Author Topic: is this a Bug in TDBEdit?  (Read 3861 times)

xaver13

  • Full Member
  • ***
  • Posts: 111
is this a Bug in TDBEdit?
« on: November 10, 2017, 12:28:23 pm »
Hello, Lazarus Windows SVN 54695. I needed Alignment for my TDBEdit field. I found not it in properties in object inspector, but I can set it up in program
Code: Pascal  [Select][+][-]
  1. DBEdit12.Alignment:=taRightJustify;

am I wrong or is it a bug?
--
Jiri Cvrk

balazsszekely

  • Guest
Re: is this a Bug in TDBEdit?
« Reply #1 on: November 10, 2017, 12:55:54 pm »
I wouldn't call it a bug,  Alignment is just public property. In order to see it in OI a property must be published.

korba812

  • Sr. Member
  • ****
  • Posts: 391
Re: is this a Bug in TDBEdit?
« Reply #2 on: November 10, 2017, 02:10:44 pm »
"Alignment" property is not published here because the alignment is taken from TField.Alignment. In addition, DBEdit.Alignemt can be overridden with a value from TField.Alignment. So use TField.Alignment property (it is published and can be edited in OI).

xaver13

  • Full Member
  • ***
  • Posts: 111
Re: is this a Bug in TDBEdit?
« Reply #3 on: November 10, 2017, 03:14:11 pm »
"Alignment" property is not published here because the alignment is taken from TField.Alignment. In addition, DBEdit.Alignemt can be overridden with a value from TField.Alignment. So use TField.Alignment property (it is published and can be edited in OI).

sorry, how can I do this? How can I find it? Where in OI? Thank you very much.
« Last Edit: November 10, 2017, 03:16:46 pm by xaver13 »
--
Jiri Cvrk

korba812

  • Sr. Member
  • ****
  • Posts: 391
Re: is this a Bug in TDBEdit?
« Reply #4 on: November 10, 2017, 03:40:03 pm »
It depends on the type of dataset.
For SQLDB, right-click on SQLQuery and select "Edit fields". Then select the database field. Then you can edit TField properties in OI.

xaver13

  • Full Member
  • ***
  • Posts: 111
Re: is this a Bug in TDBEdit?
« Reply #5 on: November 10, 2017, 06:04:09 pm »
It depends on the type of dataset.
For SQLDB, right-click on SQLQuery and select "Edit fields". Then select the database field. Then you can edit TField properties in OI.
Thank you, you showed me places I never used and I never knew they exist  :)
--
Jiri Cvrk

korba812

  • Sr. Member
  • ****
  • Posts: 391

xaver13

  • Full Member
  • ***
  • Posts: 111
Re: is this a Bug in TDBEdit?
« Reply #7 on: November 11, 2017, 11:08:42 am »
Here you can read more about datasets and fields:
http://etutorials.org/Programming/mastering+delphi+7/Part+III+Delphi+Database-Oriented+Architectures/Chapter+13+Delphi+s+Database+Architecture/The+Fields+of+a+Dataset/

I tried to use in my code something as this
Code: Pascal  [Select][+][-]
  1.  
  2. //     DBEdit5.Alignment:=taRightJustify;
  3. //     DBEdit9.Alignment:=taRightJustify;
  4. //     DBEdit12.Alignment:=taRightJustify;
  5.      Query1.FieldByName('Col_15').Alignment := taRightJustify; //DBEdit5
  6.      Query1.FieldByName('Col_19').Alignment := taRightJustify; //DBEdit9
  7.      Query1.FieldByName('Col_27').Alignment := taRightJustify; //DBEdit12  

First I tried the section now commented for DBEdits. Second, after reading your link,  I used Fields (here not commented).
Strange is that it is working fo DBEdit and DBGrid under windows, but under MacOS it is working in DBGrid but not in DBEdits.
--
Jiri Cvrk

korba812

  • Sr. Member
  • ****
  • Posts: 391
Re: is this a Bug in TDBEdit?
« Reply #8 on: November 11, 2017, 12:02:53 pm »
Probably problem is with macos widgetset. Unfortunately I have no access to mac. You can try attached project and see if alignment is changing on runtime. If not, problem affects TEdit on macos and is not TDBEdit related.

xaver13

  • Full Member
  • ***
  • Posts: 111
Re: is this a Bug in TDBEdit?
« Reply #9 on: November 11, 2017, 12:36:53 pm »
Probably problem is with macos widgetset. Unfortunately I have no access to mac. You can try attached project and see if alignment is changing on runtime. If not, problem affects TEdit on macos and is not TDBEdit related.

Hello, tried your project. It works nice under Windows. But under MacOs radio box check changes nothing.
--
Jiri Cvrk

korba812

  • Sr. Member
  • ****
  • Posts: 391
Re: is this a Bug in TDBEdit?
« Reply #10 on: November 11, 2017, 01:38:51 pm »
So you found a bug. Please report it to bugtraker and include a sample project (project, which I attached earlier, is enough).

 

TinyPortal © 2005-2018