Recent

Author Topic: I need some more advanced message box?  (Read 8610 times)

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: I need some more advanced message box?
« Reply #15 on: March 02, 2018, 09:50:14 pm »
I see what you mean.
Originally I had not implemented IsCancel or IsDefault.
I have now.
See attached project.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: I need some more advanced message box?
« Reply #16 on: March 07, 2018, 12:40:53 pm »
Thanks @howardpc,
I have made some modifications:
1. Replaced TText with TMemo to permit multiple lines.
2. Replaced TButton with TSpeedButton to permit multiple lines.
3. Added a DlgType property, to provide interchangeability with QuestionDialog. Property is ignored anyway, maybe one day it won't be.
4. Made CheckBox addable with 'IsCheckbox' in the buttons list. This way we have uni-directional compatibility with QuestionDialog and translatable caption for the checkbox.

Problems so far:
1. Main widnow does not get resized properly. You have used Anchored resizing. For some reason I dislike anchored resizing, and I am not familiar with it. I could use dynamic resizing, but maybe you would like to do it your way?
2. For some reason if
    Assigned(FDefaultButton) then ActiveControl:=FDefaultButton;
from procedure TDlgForm.DoShow;  won't compile.
3. „Copy to clipboard‟ is not translateable. Maybe I could get such a string from LCL, not quite sure what to do.   
4. I cannot make text in TSpeedButton horizontally centered. Maybe TSpeedButton is not the proper control to use?
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: I need some more advanced message box?
« Reply #17 on: March 07, 2018, 01:08:07 pm »
2. For some reason if
    Assigned(FDefaultButton) then ActiveControl:=FDefaultButton;
from procedure TDlgForm.DoShow;  won't compile.

TSpeedButton is a TGraphicControl, so it can never have the focus.
If you want to have a default button (clicked when you press Enter) you would have to simulate this if you use speedbuttons.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: I need some more advanced message box?
« Reply #18 on: March 09, 2018, 10:30:08 am »
I have replaced TButton with TToggleBox.
Problems 1;2 and 4 are solved now.
Support for DlgType is not added yet.
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: I need some more advanced message box?
« Reply #19 on: March 09, 2018, 12:39:59 pm »
I don't see the point of adding a TMsgDlgType parameter when you say you don't want any icons.
The DlgType parameter is only included to specify what icon you want shown.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: I need some more advanced message box?
« Reply #20 on: March 09, 2018, 02:04:15 pm »
I do not want icons on the buttons, I have nothing against warning, error, etc. icons (on the message box itself).
If I am not wrong TMsgDlgType shows definite caption, of none is provided.
Also, TMsgDlgType permits to simply replace QuestionDialog with this one.
« Last Edit: March 09, 2018, 02:46:26 pm by CM630 »
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: I need some more advanced message box?
« Reply #21 on: March 09, 2018, 03:50:48 pm »
OK, I understand. TMsgDlgType does give a worded Caption in addition to a generic OS icon.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: I need some more advanced message box?
« Reply #22 on: April 17, 2018, 10:20:45 am »
I have done some improvements so far.
Still I have issues, because KMemo does not want to autoresize.
When possible I will spend some more time on that.
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018