Scolring - Forum

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.

#1 15-Oct-2014 13:26:43

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

can an ObjWebNavigator be created in objcontainer?

Colleagues:
can an ObjWebNavigator be created in objcontainer?
-h

Offline

#2 15-Oct-2014 16:35:27

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: can an ObjWebNavigator be created in objcontainer?

hmm no I don't think.
there is no way to get an ObjWindow from a container

Offline

#3 15-Oct-2014 16:51:13

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: can an ObjWebNavigator be created in objcontainer?

arkeon wrote:

hmm no I don't think.
there is no way to get an ObjWindow from a container


maybe I will try that hybridgui code and create a child window from mainwindow as opposed to a child container.....
where would I find the code for creating an   ObjWebNavigator..there isn't any information at this url: http://www.scolring.org/files/doc_html/ … gator.html

Offline

#4 15-Oct-2014 17:53:34

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: can an ObjWebNavigator be created in objcontainer?

typeof oNavigator = ObjWebNavigator;;

fun createObjNavigator ()=
    set oNavigator = _CRWebNavigator _channel;
    ...

In fact, you are the SO3WebNavigator...
http://redmine.scolring.org/projects/so … idget.html


About ObjContainer, they are created from an ObjWindow (you can also create them "ex nihilo" but it is not interesting here). But you can NOT create an ObjWindow from an ObjContainer.

Offline

#5 15-Oct-2014 17:56:26

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: can an ObjWebNavigator be created in objcontainer?

I've updated the SO3 documentation here : http://redmine.scolring.org/projects/so … gator.html

you have a small sample in the about window of the OS3D editor

/**  cbDestroyAboutWin [EdWindow ObjWebNavigator] I
  *  callback on destroy about window
  *  
  *  private
  *
  *  return 0
  **/
fun cbDestroyAboutWin(winstr, navigator)=
  SO3WebNavigatorDestroy navigator;
  set winAbout = nil;
  0;;


fun cbAboutBtnWww(ctrlbtn)=
  _openbrowserhttp sOSD3Url;
  0;;


fun cbAboutNavigatorPopup(navigator, p, x, y, w, h, url)=
  _openbrowserhttp url;
  0;;


/**  cbTbBtnAbout [EdToolBar CompRollOver I I V3Dview] I
  *  callback on about button
  *  Show the about dialog
  *
  *  private
  *
  *  return 0
  **/
fun cbTbBtnAbout(tbstr, croll, btn, mask, viewstr)=
  if winAbout != nil then nil else
  let [450 500] -> [iw ih] in
  let _GETWorkingAreaSize -> [sw sh] in
  let _GETscreenPos -> [mx my] in
  let [(if ((mx + iw) > sw) then (sw - iw) else mx) (if ((my + ih) > sh) then (sh - ih) else my)] -> [x y] in
  let setEdWindowIcon (crEdWindow _channel mainInterf.MINT_winMain x y iw ih nil nil EDWIN_DIALOG "About OpenSpace3D Editor") sWinDlgIcon -> aboutwinstr in
  let SO3WebNavigatorCreate _channel aboutwinstr.EDW_win 10 130 (iw - 20) 300 "google.com" -> navigator in
  (
    crEdCtrlBitmap aboutwinstr 5 5 150 120 strcat APPBASEDIR "os3deditor/res/logo.jpg" 0xf0f0f0 nil;
    crEdCtrlLabel aboutwinstr 160 10 (iw - 170) 20 "OpenSpace3D Editor" nil;
    crEdCtrlLabel aboutwinstr 160 40 (iw - 170) 20 strcat "Current version : " getVersionName nil;
    crEdCtrlLabel aboutwinstr 160 65 (iw - 170) 20 strcat "Released on : " getVersionDate nil;
    crEdCtrlLabel aboutwinstr 160 90 (iw - 170) 20 "License : GNU Lesser General Public License" nil;
    crEdCtrlLabel aboutwinstr 10 (ih - 28) (iw - 105) 20 "Copyright I-Maginer 2014" nil;
    
    setEdCtrlButtonCb (crEdCtrlButton aboutwinstr 10 435 (iw-20) 20 "www.openspace3d.com" EDWIN_RESIZE_MW) @cbAboutBtnWww;
    setEdCtrlButtonCb (crEdCtrlButton aboutwinstr (iw - 100) (ih - 30) 90 20 "Ok" EDWIN_RESIZE_MW) mkfun2 @cbBtnCancel aboutwinstr;
    
    SO3WebNavigatorLoadFile navigator _checkpack strcat APPBASEDIR "os3deditor/res/about/about.html" nil;
    SO3WebNavigatorCbOnPopup navigator @cbAboutNavigatorPopup nil;
    set winAbout = aboutwinstr;
    setEdwindowCbDestroy winAbout mkfun2 @cbDestroyAboutWin navigator;
  );
  0;;

Offline

#6 15-Oct-2014 18:19:10

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: can an ObjWebNavigator be created in objcontainer?

you have a small sample in the about window of the OS3D editor

wow when I have time I'm going to try this with the player. my master plan is in even closer reach. thanks for posting that code and for updating the api documentation.

Last edited by hebdemnobad (15-Oct-2014 18:43:38)

Offline

#7 15-Oct-2014 22:13:19

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: can an ObjWebNavigator be created in objcontainer?

I've got a window with a container that behaves itself with the 3d buffer. so the window is a child of DMSwin, and the container is created from the child window.

/*

-----------------------------------------------------------------------------

This source file is part of the Media Octopus Player

For the latest info, see http://www.ifam.net/medioctopusplayer
[this url doens't exist at the moment]



Copyright (c) 2014 Media Octopus



This program is free software; you can redistribute it and/or modify it under

the terms of the GNU Lesser General Public License as published by the Free Software

Foundation; either version 2 of the License, or (at your option) any later

version.



This program is distributed in the hope that it will be useful, but WITHOUT

ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS

FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.



You should have received a copy of the GNU Lesser General Public License along with

this program; if not, write to the Free Software Foundation, Inc., 59 Temple

Place - Suite 330, Boston, MA 02111-1307, USA, or go to

http://www.gnu.org/copyleft/lesser.txt



-----------------------------------------------------------------------------

*/





//struct definition
  struct Hybrid_GUI = [
  Hybrid_GUI_plugin_instance           				: PInstance,
  Hybrid_GUI_window											: ObjWin,
  Hybrid_GUI_window_object_container					: ObjContainer,
  Hybrid_GUI_height											: I,
  Hybrid_GUI_width											: I,
  Hybrid_GUI_minimized										: I
  				
  ]mkHybrid_GUI;;
  



fun deleteOb(inst, hybrid_GUI)=
//get size of main window so we can resize 3d buffer
let _GETwindowPositionSize DMSwin -> [dmsx dmsy dmsw dmsh] in
  (
	 let V3DgetSessionView c3dXsession -> viewstr in
  			//restore v3dview to full width and height
  			(
  				V3DresizeView viewstr 0 0 dmsw dmsh;
  			);
  	);
_DScontainer hybrid_GUI.Hybrid_GUI_window_object_container; 
_DSwindow hybrid_GUI.Hybrid_GUI_window;


  0;;
  
  

fun cbResizeMainGui(winstr, w, h, hybrid_GUI_instance) =
    let V3DgetSessionView c3dXsession -> viewstr in
    (
      //make v3dview 600 pixels wide and 450 high so it leaves room for non3d window and container this doesn't seem to work
      V3DresizeView viewstr 0 0 w (h - 150);
      _SIZEwindow hybrid_GUI_instance.Hybrid_GUI_window w 150 0 (h - 150);
      _SIZEcontainer hybrid_GUI_instance.Hybrid_GUI_window_object_container 0 0 w 150;
      _PAINTcontainer hybrid_GUI_instance.Hybrid_GUI_window_object_container;
    );
  0;;



fun cbhideGUI(inst, from, action, param, rep, hybrid_GUI)=

if hybrid_GUI.Hybrid_GUI_minimized ==1 then 
(
nil;
0;
)
	 else
(
//hide 2d gui
_SHOWwindow hybrid_GUI.Hybrid_GUI_window WINDOW_HIDDEN;
_ENcontainer hybrid_GUI.Hybrid_GUI_window_object_container 0;
_SHOWcontainer hybrid_GUI.Hybrid_GUI_window_object_container	CONTAINER_HIDDEN;
_showconsole;
//set minimized flag to 1
 set hybrid_GUI.Hybrid_GUI_minimized =1;
//get size of main window so we can resize 3d buffer
let _GETwindowPositionSize mainWindow.EDW_win-> [dmsx dmsy dmsw dmsh] in
  (
	 let V3DgetSessionView c3dXsession -> viewstr in
  			//restore v3dview to full width ane height
  			(
  				V3DresizeView viewstr 0 0 dmsw dmsh;
  				_fooS "the new height of the 3d window is:";
  				_fooId dmsh;
  			);
  	);
//return 0 close else brace
 0;
);


  0;;
  
  
  
  fun cBshowGUI(inst, from, action, param, rep, hybrid_GUI)=
  
  if (hybrid_GUI.Hybrid_GUI_minimized == 0) then
  (
  nil;
  0;
  )
  else
  (
//get size of main window so we can resize 3d buffer and make it 150 pixels less high
let _GETwindowPositionSize mainWindow.EDW_win -> [dmsx dmsy dmsw dmsh] in
  (
  	//set minimized flag to 0
 	set hybrid_GUI.Hybrid_GUI_minimized = 0;
_SHOWwindow hybrid_GUI.Hybrid_GUI_window WINDOW_UNHIDDEN;
_ENcontainer hybrid_GUI.Hybrid_GUI_window_object_container 1; 
  	_SHOWcontainer hybrid_GUI.Hybrid_GUI_window_object_container	CONTAINER_UNHIDDEN;
	 let V3DgetSessionView c3dXsession -> viewstr in
  			//restore v3dview to full width ane height
  			(
  				V3DresizeView viewstr 0 0 dmsw (dmsh-150);
  				_fooS "the new height of the 3d window is:";
  				_fooId dmsh;
  			);
  	);
 //return 0 close then brace
 0;
 );


  0;;



  


  



fun newOb(inst)=

  // test if we are in editor then we stop the play mode

  if (_test_exist "stopEditorFromPlugin") then

  (

    0;

  )

  else

  (

  let _GETwindowPositionSize mainWindow.EDW_win -> [dmsx dmsy dmsw dmsh] in
  let _CRwindow _channel mainWindow.EDW_win 0 (dmsh - 150) dmsw 150 WN_CHILDINSIDE|WN_HIDDEN "HYBRIDGUIWINDOW"  -> hybridguiwindow in 
  let _CRcontainerFromObjWin _channel hybridguiwindow 0 0 dmsw 150 CO_CHILDINSIDE|CO_DISABLE 0x000000 "gui_container_name" -> twodguicontainer in
    //create new hybridGUI object
  let mkHybrid_GUI [inst hybridguiwindow twodguicontainer  dmsw (dmsh - 150) 0] -> hybrid_GUI_instance in
  (
  		   setEdwindowCbSize mainWindow mkfun4 @cbResizeMainGui hybrid_GUI_instance;
			setPluginInstanceCbDel inst mkfun2 @deleteOb hybrid_GUI_instance;
			PluginRegisterAction inst "Hide GUI" mkfun6 @cbhideGUI hybrid_GUI_instance;
			PluginRegisterAction inst "Show GUI" mkfun6 @cBshowGUI hybrid_GUI_instance;
   //close let brace
    );
	//return 0 close then brace

    0;

  );



 

  0;;





fun IniPlug(file)=

  PlugRegister @newOb nil;

  setPluginEditor @dynamicedit;

  0;;

Last edited by hebdemnobad (15-Oct-2014 22:14:06)

Offline

#8 16-Oct-2014 00:36:17

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,541
Website

Re: can an ObjWebNavigator be created in objcontainer?

Offline

#9 16-Oct-2014 08:35:59

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: can an ObjWebNavigator be created in objcontainer?

cool smile

Offline

Board footer

Powered by FluxBB