Discussions related to Visual Prolog
Audun Tönnesen
Active Member
Posts: 36
Joined: 27 Apr 2000 23:01

no closing of message window

Unread post 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?
Regards,
Audun.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post 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().
Regards Thomas Linder Puls
PDC
Audun Tönnesen
Active Member
Posts: 36
Joined: 27 Apr 2000 23:01

Unread post 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
MessageForm: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.
Regards,
Audun.
Audun Tönnesen
Active Member
Posts: 36
Joined: 27 Apr 2000 23:01

Unread post 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
Regards,
Audun.
Audun Tönnesen
Active Member
Posts: 36
Joined: 27 Apr 2000 23:01

Unread post 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.
Regards,
Audun.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post 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.
Regards Thomas Linder Puls
PDC
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

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

Unread post by Ferenc Nagy »

I have dealt with this problem in my contribution http://wiki.visual-prolog.com/index.php ... 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)).        
TIA, Regards,
Frank Nagy
Audun Tönnesen
Active Member
Posts: 36
Joined: 27 Apr 2000 23:01

Unread post 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.
Regards,
Audun.
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

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

Unread post by Ferenc Nagy »

Audun,

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.
TIA, Regards,
Frank Nagy
Audun Tönnesen
Active Member
Posts: 36
Joined: 27 Apr 2000 23:01

Unread post by Audun Tönnesen »

In the new(...)-clause, fourth line??
Regards,
Audun.
Post Reply