Page 1 of 1

no closing of message window

Posted: 19 Jun 2014 13:05
by Audun Tönnesen
I'm going to use the message window actively in an app, so I don't want the user to close it.
Looking in the code (and inherited code, and other in herited code...) I see many references to frame decorations, but the question is: is there ONE place to skip the close-box of the message window without interfering with other windows?

Posted: 23 Jun 2014 17:56
by Thomas Linder Puls
You can change the decoration in the taskWindow, before you show the form:

Code: Select all

predicates     onShow : window::showListener. clauses     onShow(_, _CreationData) :-         MessageForm = messageForm::new(This),         MessageForm:setDecoration(titlebar([])),         MessageForm:show().

Posted: 24 Jun 2014 7:09
by Audun Tönnesen
Something funny here....

I wanted no closebutton, but still keep minimizebutton and maximizebutton. However, it seems this predicate is a "all or none." If I try this, there's no buttons at all:

onShow(_, _CreationData) :-
MessageForm = messageForm::new(This),
MessageForm:setDecoration(titlebar([minimizebutton(), maximizebutton()])), %Only two buttons, but they don't show

I've tested the same thing with the task-window: same result: deleting the closebutton() from the decoration-list renders a taskwindow titlebar without buttons at all.

Posted: 24 Jun 2014 7:14
by Audun Tönnesen
The "opposite" is possible, though: if I delete the minimize- and maximize- buttons from the list, but keep the closebutton, the window is renderet with only closebutton:

setDecoration(titlebar([closebutton()])), %Only close button will be rendered

Posted: 24 Jun 2014 7:39
by Audun Tönnesen
Crisis ! After I tinkered with the Taskwindow (automatic generated code), there's a fatal link error:

Type Description Filename f2505 Fatal error 2505: Cannot create file 'Exe\fallkon.exe', errno=13 fallkon.exe

I've deleted OBJ-directory, restarted system, Rebuilt All, but no use. And of course, I've mended the code (creation of task-window) by copying it in from one of the example-programs.

Posted: 24 Jun 2014 8:03
by Thomas Linder Puls
A Microsoft Windows window cannot have minimize and maximize unless it have close.

The error:
Type Description Filename f2505 Fatal error 2505: Cannot create file 'Exe\fallkon.exe', errno=13 fallkon.exe
comes when you then program (i.e. falkon.exe) is still running while you try to create a new one.

Booting will of course help, but closing the program is sufficient.

Creation of message window with user defined buttons and redirection of standerd output

Posted: 24 Jun 2014 14:39
by Ferenc Nagy
I have dealt with this problem in my contribution ... d:TestDraw.
I have omitted the handling of the relative distance of the frames of message window from the client rectangle of the task window from the code excerts below

Code: Select all

% Construction with given buttons in the titlebar and and close responder   constructors         % Construction with given buttons in the titlebar and and close responder         new:(window Parent,         frameDecoration::decoration Buttons, % Buttons on the titlebar.         frameDecoration::closeResponder CloseMode,         string Title, font,  boolean RedirectStdio).   constants % Display with changed titlebar and closing modes.   max_min_button:frameDecoration::decoration=frameDecoration::titlebar([frameDecoration::maximizebutton(),frameDecoration::minimizebutton()]). max_min_close_button:frameDecoration::decoration=frameDecoration::titlebar([frameDecoration::maximizebutton(),frameDecoration::minimizebutton(),frameDecoration::closeButton()]).   predicates     denyCloseResponder(_)=denyClose().       acceptCloseResponder(_)=acceptClose().     clauses         new(Parent,Buttons,CloseResponder,Title, Font,  RedirectStdio) :-         formWindow::new(Parent),         setText(Title),         formMessageControl := messageControl::new(This),         formMessageControl:setLines(MaxLines),         % The listeners react the change of the size of the parent window.         addSizeListener(resizeListener),         addGetFocusListener(focusListener),         addUserListener(         Parent:addSizeListener(onParentResize),         onParentResize(Parent),         % These are the settings of added properites         addDestroyListener(onDestroy),         setCloseResponder(CloseResponder),         setDecoration(Buttons),         if RedirectStdio=true then             stdio::setOutputStream(formMessageControl:getOutputStream())         end if.   predicates     onDestroy : destroyListener. clauses     onDestroy(_) :-         if redirected_output=true then             stdio::setOutputStream(ini_out_stream)         end if,         Parent=getParent(),         Parent:removeSizeListener(onParentResize),         retractAll(instance(This)).        

Posted: 26 Jun 2014 11:22
by Audun Tönnesen
Thanks for contribution, Frank!
I admit it went "over my head," but anyway...

I decided to just ditch the message window and use a sciLexer editor instead.

Is not the frame of Scilexer message window the same as the old fashioned one?

Posted: 26 Jun 2014 13:00
by Ferenc Nagy

If you inspect the code than you'll see that even if
formMessageControl : messageControl is replaced by a scilexer control within the message window,
but the modified handling of the window frame around it is still usable.

Posted: 27 Jun 2014 21:37
by Audun Tönnesen
In the new(...)-clause, fourth line??