Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
colleagues:
for the text input/output plugit I've been working on, I'd like the editor to be able to set window flags. in the api online all the flags are of the form I.
How would I set some flags and not others?
Are the flags set as a list of intergers? something like:
1::0::1::1::0::1::nil
in the order that they are listed on the api (http://www.scolring.org/files/doc_html/_crwindow.html) for example:
WN_MINIMIZE	window is created as minimized
WN_HIDDEN	window is created as hidden
WN_MENU	add a menu bar to the window
WN_MINBOX	display a minimize icon on the menu bar
WN_SIZEBOX	window has a resizable border
WN_NOBORDER	window has no border
WN_NOCAPTION	window has no title
WN_CHILDINSIDE	window is a child window, without title and border
WN_DOWN	display a 3d border
WN_DRAGDROP	allow drag and drop inside the window
WN_MAX	display a maximize icon on the menu bar
WN_TOPMOST	always on top
WN_NOSCOL	removes the "(Scol)" word in windows titles.
WN_CHILD	similar at WN_CHILDINSIDE but allows others options
WN_CHILDMENU	
allow the system menu to the child windowso would this work?
set win = _CRwindow _channel nil 0 0 300 200 1 "Test Child"
instead of 
set win = _CRwindow _channel nil 0 0 300 200 WN_NORMAL "Test Child"
Offline
Don't use a "numeric" value directly.
If you want to combine any flags (it is the same thing for all Scol functions with flags) :
set win = _CRwindow _channel nil 0 0 300 200 WN_MINBOX|WN_NOBORDER|WN_TOPMOST "Test Child";Separate each flag with an 'binary or' : |
Offline
It is not recommended to use integers instead of the "named" flags. This would 1) make your code less comprehensible (even for you) and 2) let you vulnerable to changes in the VM code.
Bob
Offline
[solved]
I see a way of setting flags in cmainwindow.pkg so disregard my question colleagues:
///scol code
let WN_MENU|WN_SIZEBOX -> style in
    (
      if (border) then nil else
        set style = style | WN_NOBORDER;
      
      if (caption) then nil else
        set style = style | WN_NOCAPTION;
      
      if (resize) then nil else
        set style = style & ~(WN_SIZEBOX);
      
      if (!catchClose) then nil else
      _CBwinClose mainWindow.EDW_win @cbWinClose inst;
      _SETwindowStyle mainWindow.EDW_win style;
      
    //more codeOffline
I don't understand what you want to do but there is a very strange thing in this code :
if (!catchClose) then nil else _CBwinClose mainWindow.EDW_win @cbWinClose inst; _SETwindowStyle mainWindow.EDW_win style;
Your else block is only :
_CBwinClose mainWindow.EDW_win @cbWinClose inst;Maybe it is right about your idea ... ![]()
Offline
I don't understand what you want to do but there is a very strange thing in this code :
hebdemnobad wrote:if (!catchClose) then nil else _CBwinClose mainWindow.EDW_win @cbWinClose inst; _SETwindowStyle mainWindow.EDW_win style;Your else block is only :
_CBwinClose mainWindow.EDW_win @cbWinClose inst;Maybe it is right about your idea ...
thx Iri, Arkeon helped me out in the other thread you just commented on as for the callback issue. I will probably separate the modifications from the mainwindow code as I ended up not using any of it save for learning how to invoke functions of the root window for the player.
I just posted that code to show how the flags can be changed dynamically.
Last edited by hebdemnobad (10-Oct-2014 16:36:02)
Offline