Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / customdrawn / 2012-05

Dialog problems. attn Felipe or zeljko

8 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuliano Colla

As you may gather from my silence, I'm still quite busy, and I can hardly find some time to spare to carry on work on customdrawn.

However, having a small window of time, I gave a look to Dialog implementation.

I have already implemented for some applications of mine a set of custom dialogs, because I needed large fonts, and more lines of text.

It fits easily on customdrawn, because it's fully backend and widgetset independent. It just creates a form, populates it with buttons, text, and whatever, sizes the form to fit, opens it modal and when it's done the form is released.
I have also implemented custom file/directory dialogs on the same line, so I was thinking to take advantage of that as a second step.

All is good and well, but it doesn't work properly in X11 customdrawn. When the modal form is closed and released, any action on the main form gives rise to a sigsev, as if the form released had been the main form instead of the modal one.

Scenario:
1) My dialog work properly with GTK and QT widgetset.
2) My dialog causes sigsev after being released in X11 customdrawn.
3) My dialog works properly also in X11 customdrawn if the form is just hidden instead of released.

My question is: is that a known issue, maybe already solved in between, or it deserves investigation?
On my next time slot I could try to follow the code to understand what goes wrong when the form is released, but only if nobody else has already done it!

When I'm done with current busyness I'll try to gather the episodes I've lost...

Giuliano

Felipe Monteiro de Carvalho
to Giuliano Colla
Giuliano Colla wrote 9 lines
I have already implemented for some applications of mine a set of custom dialogs, because I needed large fonts, and more lines of text. It fits easily on customdrawn, because it's fully backend and widgetset independent. It just creates a form, populates it with buttons, text, and whatever, sizes the form to fit, opens it modal and when it's done the form is released. I have also implemented custom file/directory dialogs on the same line, so I was thinking to take advantage of that as a second step.

We need such dialogs in the unit lazarus/lcl/lazdialogs.pas

Note that we need 2 version of each dialog: 1 for desktops and 1 for mobiles. I wrote so far only mobile dialogs, so your dialogs are very welcome =) Please make a proper patch for the unit lazdialogs.pas

Note that although the dialogs might have extra functionality (which can be set via something), the focus should be in being as standard as possible, just like Qt or Gtk2 dialogs in X11.

Show quoted text 13 lines
All is good and well, but it doesn't work properly in X11 customdrawn. When the modal form is closed and released, any action on the main form gives rise to a sigsev, as if the form released had been the main form instead of the modal one. Scenario: 1) My dialog work properly with GTK and QT widgetset. 2) My dialog causes sigsev after being released in X11 customdrawn. 3) My dialog works properly also in X11 customdrawn if the form is just hidden instead of released. My question is: is that a known issue, maybe already solved in between, or it deserves investigation?

No, it is not know. But you can first send a patch for lazdialogs and then we can see about this problem.

lazdialogs should be totally not specific to customdrawn. It should be usable with all other widgetsets too, so we can solve these 2 issues separately.

Felipe Monteiro de Carvalho
Giuliano Colla
to Felipe Monteiro de Carvalho

Il 02/05/2012 19:55, Felipe Monteiro de Carvalho ha scritto:

Show quoted text 11 lines
We need such dialogs in the unit lazarus/lcl/lazdialogs.pas Note that we need 2 version of each dialog: 1 for desktops and 1 for mobiles. I wrote so far only mobile dialogs, so your dialogs are very welcome =) Please make a proper patch for the unit lazdialogs.pas Note that although the dialogs might have extra functionality (which can be set via something), the focus should be in being as standard as possible, just like Qt or Gtk2 dialogs in X11.

OK, understood. I can't promise to make it quickly, because next week I'll be completely unavailable, traveling in Spain, and now I must prepare what I'll test there, but I'll do my best to make it not too slow.

Giuliano

Giuliano Colla
to Felipe Monteiro de Carvalho: On Tue, May 1, 2012 at 5:11 PM, Giuliano Colla We need such dialogs in the unit…

Felipe Monteiro de Carvalho ha scritto:

Show quoted text 5 lines
lazdialogs should be totally not specific to customdrawn. It should be usable with all other widgetsets too, so we can solve these 2 issues separately.

I have implemented Message Dialogs, and now I'm ready to provide a patch for LazDialogs, but I have a few questions.

1) My plan would be to follow exactly the way of the standard LCL Dialog unit: it provides a MessageDlg function, overloaded in a number of versions to offer different options, plus some other functions like MessageBox, etc. So I would provide our corresponding number of overloaded LazMessageDlg functions, a LazMessageBox etc. Is that Ok or the plan was somewhat different?

2) Dialog unit contains only the Interface section, while implementation is a number of includes. Wold you prefer to follow the same line from the beginning, or better keep everything in the main unit while the size is manegeable?

3) Message dialogs offer among the possible buttons also a Help button, and there is a HelpContext parameter, for a Help dialog. I've never used this feature and I have no idea of how it works. Do you have some knowledge on that line, can you point me to a wiki page which explains everything, or we will just leave it unimplemented, waiting for future upgrade?

Giuliano

Giuliano Colla Before activating the tongue, make sure that the brain is connected (anonymous)
Felipe Monteiro de Carvalho
to Giuliano Colla

Ops, sorry, I forgot to answer this one =)

Giuliano Colla wrote 6 lines
1) My plan would be to follow exactly the way of the standard LCL Dialog unit: it provides a MessageDlg function, overloaded in a number of versions to offer different options, plus some other functions like MessageBox, etc. So I would provide our corresponding number of overloaded LazMessageDlg functions, a LazMessageBox etc. Is that Ok or the plan was somewhat different?

I think it is a good idea.

2) Dialog unit contains only the Interface section, while implementation is a number of includes. Wold you prefer to follow the same line from the beginning, or better keep everything in the main unit while the size is manegeable?

I'd keep in the same file for now. We can split later if necessary.

Show quoted text 5 lines
3) Message dialogs offer among the possible buttons also a Help button, and there is a HelpContext parameter, for a Help dialog. I've never used this feature and I have no idea of how it works. Do you have some knowledge on that line, can you point me to a wiki page which explains everything, or we will just leave it unimplemented, waiting for future upgrade?

I don't remember ever seeing where this is implemented in the LCL, I don't know much about this part.

Felipe Monteiro de Carvalho
Giuliano Colla
to Felipe Monteiro de Carvalho

Felipe Monteiro de Carvalho ha scritto:

Show quoted text 29 lines
Ops, sorry, I forgot to answer this one =) On Fri, May 4, 2012 at 5:51 PM, Giuliano Colla wrote: > 1) My plan would be to follow exactly the way of the standard LCL Dialog > unit: it provides a MessageDlg function, overloaded in a number of versions > to offer different options, plus some other functions like MessageBox, etc. > So I would provide our corresponding number of overloaded LazMessageDlg > functions, a LazMessageBox etc. Is that Ok or the plan was somewhat > different? I think it is a good idea. > 2) Dialog unit contains only the Interface section, while implementation is > a number of includes. Wold you prefer to follow the same line from the > beginning, or better keep everything in the main unit while the size is > manegeable? I'd keep in the same file for now. We can split later if necessary. > 3) Message dialogs offer among the possible buttons also a Help button, and > there is a HelpContext parameter, for a Help dialog. I've never used this > feature and I have no idea of how it works. Do you have some knowledge on > that line, can you point me to a wiki page which explains everything, or we > will just leave it unimplemented, waiting for future upgrade? I don't remember ever seeing where this is implemented in the LCL, I don't know much about this part.

I've been silent for a long time, because I've been quite busy. But I squeezed in some work for CustomDrawn Dialogs.

It turned out that my implementation wasn't usable at all (I was using a pre-built form with an lfm file) and I've been forced to rewrite everything from scratch.

Now I'm somewhere halfway. I've got a functioning basic LazDialog, but it's not really CustomDrawn, because it's actually showing WS BitButtons.

Next step would be implementing the minimal CDBitButton functionality required for dialog buttons (basically setting the proper Kind, and the Modal Result, and maybe implementing AutoSize) starting from CDButton.

Shall I do it, or there's already work in progress in that direction, and I'd be reinventing the wheel?

One more question. LazDialogs is compiled in Delphi mode, while what I've done (and kept in a separate module for the time being) is compiled in fpc mode. Shall I fix that too, or there's a deep reason to keep Delphi mode for LazDialogs?

Giuliano

Giuliano Colla Before activating the tongue, make sure that the brain is connected (anonymous)
Felipe Monteiro de Carvalho
to Giuliano Colla
Giuliano Colla wrote
It turned out that my implementation wasn't usable at all (I was using a pre-built form with an lfm file) and I've been forced to rewrite everything from scratch.

I think that it is better to write the dialog in code completely, without any LFM.

Now I'm somewhere halfway. I've got a functioning basic LazDialog, but it's not really CustomDrawn, because it's actually showing WS BitButtons.

The dialogs should use LCL controls and be usable in any widgetset, so this is correct.

Show quoted text 6 lines
Next step would be implementing the minimal CDBitButton functionality required for dialog buttons (basically setting the proper Kind, and the Modal Result, and maybe implementing AutoSize) starting from CDButton. Shall I do it, or there's already work in progress in that direction, and I'd be reinventing the wheel?

You can work on that. I think that there is already a partial implementation. CDButton supports glyph in itself.

One more question. LazDialogs is compiled in Delphi mode, while what I've done (and kept in a separate module for the time being) is compiled in fpc mode. Shall I fix that too, or there's a deep reason to keep Delphi mode for LazDialogs?

Like you prefer, for me it doesn't matter.

Felipe Monteiro de Carvalho
Giuliano Colla
to Felipe Monteiro de Carvalho

Il 03/09/2012 20:05, Felipe Monteiro de Carvalho ha scritto:

Show quoted text 10 lines
On Mon, Sep 3, 2012 at 6:42 PM, Giuliano Colla wrote: Next step would be implementing the minimal CDBitButton functionality required for dialog buttons (basically setting the proper Kind, and the Modal Result, and maybe implementing AutoSize) starting from CDButton. Shall I do it, or there's already work in progress in that direction, and I'd be reinventing the wheel? You can work on that. I think that there is already a partial implementation. CDButton supports glyph in itself.

Ok.

Show quoted text 5 lines
> One more question. LazDialogs is compiled in Delphi mode, while what I've > done (and kept in a separate module for the time being) is compiled in fpc > mode. Shall I fix that too, or there's a deep reason to keep Delphi mode for > LazDialogs? Like you prefer, for me it doesn't matter.

Then I'll switch to fpc mode, for uniformity with the rest of Lazarus sources.

I'll let you know when I have something worth testing.

Giuliano