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:
i'm using
_GETdesktopSize
to get the dimensions of a desktop and create/resize a window to fit in the desktop, shrinking the window depending on the size of the windows taskbar.
however, my window extends below the taskbar
i know there is a workaround for this that the editor uses (but the mainwindow plugit does not), since the editor behaves correctly (it always resizes to adjust to the present taskbar size, no matter how large, small, or hidden), but don't quite know where to look
Last edited by hebdemnobad (19-Nov-2014 13:48:48)
Offline
thx iri, i tried it but the window still ignores the taskbar size
here is how i create window:
crEdMainWindow _channel nil 0 0 sw sh WN_HIDDEN strcatn "MediaOctopus3d Player : "::projname::nil
and when so3 engine is done initializing, I have tried:
fun destroy_initializer()=
let _GETdesktopSize -> [sw sh] in
(
//code
_SIZEwindowEx mainWindow.EDW_win sw sh 0 0;
_SHOWwindow mainWindow.EDW_win WINDOW_MAXIMIZED;
);
0;;
and the window still ignores the taskbar
Last edited by hebdemnobad (18-Nov-2014 16:49:41)
Offline
there a function called
let _GETWorkingAreaSize -> [sw sh] in
it gives the size of the working area on several monitors and without the taskbar size.
Offline
there a function called
let _GETWorkingAreaSize -> [sw sh] init gives the size of the working area on several monitors and without the taskbar size.
thx....but it still doesn't work...i.e. window appears behind taskbar
Offline
hmm when you create the window it do not take the size of the title bar in account.
you can use this http://www.scolring.org/files/doc_html/ … dowex.html with the size returned by _GETWorkingAreaSize
Offline
i've only tested this on my laptop (not tablet)...it seems like flags do alot of interaction that determine the final size of the window...and yes arkeon _SIZEwindowEx is what helped things to work. WN_TOPMOST prevents proper sizing. If there is a container in the window CO_MAXIMIZED also causes misbehavior. WN_NOBORDER and WN_NOCAPTION also causes changes in size.
in my app i manged to make an edmainwindow and regular scol window fit into the dekstop properly. for some reason _GETWorkingAreaSize returns more of a yvalue than _GETdesktopSize .
this is what worked with an edmainwindow (excerpts from longer function)
let _GETdesktopSize -> [sw sh] in
(
//code
set mainWindow = setEdWindowIcon (crEdMainWindow _channel nil 0 0 sw sh WN_HIDDEN|WN_NORMAL strcatn "MediaOctopus3d Player : "::projname::nil) sWinPlayerMainIcon;
//code..
this is what worked with a regular scol window with an object container in it..this looks messy but once i'm sure things are working i'll clean things up
fun initOs3dPlayer(file, projname, pw ,ph, fullscreen)=
let _GETdesktopSize -> [dtw dth] in
let _GETWorkingAreaSize -> [ssw ssh] in
//create 3d engine initilizingwindow as hidden, centered on screen...THIS CODE SIZES CORRECTLY TO DESKTOP TAKING INTO ACCOUNT TASKBAR THIS SHOULD BE DEFAULT DESKTOP MODE AS OPPOSED TO FULLSCREEN MODE, WHICH WILL TAKE UP WHOLE SCREEN
let _CRwindow _channel nil 0 0 dtw dth WN_NORMAL|WINDOW_HIDDEN "Initializing Window" -> octo3dinitializing_window in
//create 3d engine initilizingw container, child of octo3dinitializing_window
let _CRcontainerFromObjWin _channel octo3dinitializing_window 0 0 dtw dth CO_MAXIMIZE|CO_CHILDINSIDE 0x000000 "3dinitializingcontainer" -> initializing_conatiner in
//create an initializing font
let _CRfont _channel 24 0 0 "Lucida Console" -> initializingfont in
//create initializing image
let G2DloadAlphaBmp _channel strcat APPBASEDIR "mediaoctopus3dplayer/monstersplash.png" -> initializing_image in
//put image in container
let _CRcompBitmap _channel initializing_conatiner nil [0 0] OBJ_ENABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK initializing_image 0 0 dtw dth -> initializing_combitmap in
//create initializing comptext
let _CRcompText _channel initializing_conatiner nil [0 0] OBJ_DISABLE|CT_CENTER|CT_LABEL|CT_WORDWRAP|CT_LABEL|CT_SELECT OBJ_CONTAINER_KEYDOWN 400 150 strcatn "\n"::"\n"::"Starting Up 3d Rendering Engine"::nil initializingfont [0xffffff 0 0 0xffffff] [0xffffff 50] nil nil -> initializing_comptext in
let _starttimer _channel 2500 -> intializing_timer in
//get desktop size
let _GETWorkingAreaSize -> [sw sh] in
//mk octoplayer
let mkOcto3dplayer [0 nil octo3dinitializing_window initializing_image initializing_conatiner initializingfont initializing_comptext intializing_timer nil nil nil nil [dtw dth] [dtw dth] nil nil nil nil nil nil nil nil nil nil nil] -> octoplayerstruct in
let [file projname pw ph fullscreen octoplayerstruct sw sh] -> user_parameter in
(
//_SHOWwindow octo3dinitializing_window WINDOW_MAXIMIZED;
_SHOWwindow octo3dinitializing_window WINDOW_UNHIDDEN;
_rfltimer intializing_timer @octoinitOs3dPlayer user_parameter;
_SIZEwindowEx octo3dinitializing_window dtw dth 0 0;
_PAINTwindow octo3dinitializing_window;
_PAINTcontainer initializing_conatiner;
);
0;;
i used this to figure how these functions work, desktop height returned the smallest value, fwiw screen and workingareasize were the same.
//code
let _GETWorkingAreaSize -> [waw wah] in
let _GETdesktopSize -> [dtw dth] in
let _GETscreenSize -> [screenwidth screenheight] in
(
_showconsole;
_fooSList "working area height:":: (itoa wah):: "desktop height"::(itoa dth):: "screen height":: (itoa screenheight)::nil;
);
thx again for your help, problem of the afternoon solved...since i plan to manage the main app window with vb.net i don't know many of these problems i will have to deal with....i guess instead of dealing with interaction with the whole screen i will be dealing with interaction with a vb form...i'm sure some issues will pop up there as a result of my tinkering.
Offline
maybe I inverted _GETdesktopSize and _GETWorkingAreaSize behavior in my mind
sometimes I think of wearing those glasses that turn everything you see upside down for a few days...after a while the effect wears off, until you take off the glasses.
Offline
sometime I just would like to turn my brain off looking at buoyancy forces... just played a game where the effect was awesome ^^
Offline
{ If you meet an undocumented function, report them in the redmine : http://redmine.scolring.org/issues/500
thanks }
Offline