File: n_explorer.sru
Size: 20980
Date: Mon, 07 Apr 2008 21:32:49 +0200
$PBExportHeader$n_explorer.sru
$PBExportComments$Explorer
forward
global type n_explorer from n_base
end type
type str_module from structure within n_explorer
end type
end forward

type str_module from structure
   string      classname
   string      displayname
   integer     id
   integer     itemhandle
   treeviewitem      tvitem
   u_explorer     object
   integer     mode
end type

global type n_explorer from n_base
event ke_toolbar_buttonclicked ( readonly string buttonid,  readonly string buttontext,  readonly string buttondata )
event ke_toolbar_dropdown ( readonly string buttonid,  readonly string buttontext,  readonly string buttondata,  readonly integer popx,  readonly integer popy )
event type integer ke_closeallmodules ( )
event type boolean ke_canclosemodule ( )
event ke_closemodule ( )
event ke_maxtabsreached ( )
event type integer ke_tvselectionchanging ( readonly integer oldhandle,  readonly integer newhandle )
event ke_tvselectionchanged ( readonly integer oldhandle,  readonly integer newhandle )
event type integer ke_tabselectionchanging ( readonly integer oldindex,  readonly integer newindex )
event type boolean ke_canclosetab ( readonly integer ai_index )
event ke_moduleopened ( readonly string as_classname,  readonly string as_title )
end type
global n_explorer n_explorer

type variables
Public:

string #ModuleDatastore
integer #MaxList = 10

Protected:

n_explorer_navigator inv_nav
u_tv_explorer itv //treeview
u_sheets_explorer iuo_sheets //sheet tab
u_dwtb_explorer iuo_dwtoolbar //dwtoolbar
u_splitcontainer_explorer iuo_splitter //splitconatiner
u_border_explorer iuo_title //border title
u_statusbar_explorer iuo_statusbar //status bar

Private:
str_module istr_modules[]
n_ds ids_modules
u_explorer iuo_current_explorer

CONSTANT string BACK_BUTTON = "1"
CONSTANT string FORWARD_BUTTON = "2"
CONSTANT string FOLDER_BUTTON = "5"
CONSTANT string UP_BUTTON = "3"
CONSTANT string CLOSE_BUTTON = "7"

boolean ib_fromtabselection
boolean FORCE_CLOSE
end variables

forward prototypes
public subroutine of_uponefolder ()
public subroutine of_showtreepane (readonly boolean ab_show)
public function integer of_getobjectindex (readonly dragobject ado)
protected function integer of_getavailableindex ()
public function u_statusbar_explorer of_getexplorerstatusbar ()
public function u_border_explorer of_getexplorertitle ()
public function u_tv_explorer of_getexplorertreeview ()
public function u_dwtb_explorer of_getexplorertoolbar ()
public function u_sheets_explorer of_getexplorersheets ()
public function u_splitcontainer_explorer of_getexplorersplitter ()
public subroutine of_registertreeview (readonly u_tv_explorer atv)
public subroutine of_registertitlebar (readonly u_border_explorer auo_titlebar)
public subroutine of_registerstatusbar (readonly u_statusbar_explorer auo_statusbar)
public subroutine of_registersplitter (readonly u_splitcontainer_explorer auo_splitter)
public subroutine of_registersheets (readonly u_sheets_explorer auo_sheets)
public subroutine of_registertoolbar (readonly u_dwtb_explorer auo_toolbar)
public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_dwtb_explorer auo_toolbar, readonly u_splitcontainer_explorer auo_splitter, readonly u_border_explorer auo_titlebar, readonly u_statusbar_explorer auo_statusbar)
public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_dwtb_explorer auo_toolbar, readonly u_splitcontainer_explorer auo_splitter, readonly u_border_explorer auo_titlebar)
public subroutine of_lockcontrols (readonly boolean ab_lock)
public function integer of_cleanup ()
public function integer of_focuscurrentmodule ()
public subroutine of_forceclose ()
public function u_explorer of_openmodule (readonly long al_itemhandle)
public subroutine of_setmode (readonly u_explorer auo, readonly integer ai_mode)
public subroutine of_setmodules (readonly n_ds ads)
public function integer of_populatemodules ()
public subroutine of_setmodules (readonly string ads)
public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets)
public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_splitcontainer_explorer auo_splitter)
public function string of_getclassnamefromnode (readonly long nodeid)
public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_dwtb_explorer auo_toolbar, readonly u_splitcontainer_explorer auo_splitter)
end prototypes

event ke_toolbar_buttonclicked(readonly string buttonid, readonly string buttontext, readonly string buttondata);CHOOSE CASE buttonid
   CASE BACK_BUTTON
      IF ISVALID(inv_nav) THEN inv_nav.EVENT ke_back()
   CASE FORWARD_BUTTON
      IF ISVALID(inv_nav) THEN inv_nav.EVENT ke_forward()
   CASE FOLDER_BUTTON
      of_showtreepane(NOT iuo_dwtoolbar.of_IsButtonChecked(buttonid))
   CASE UP_BUTTON
      of_UpOneFolder()
   CASE CLOSE_BUTTON
      EVENT ke_closemodule()
END CHOOSE
end event

event ke_toolbar_dropdown(readonly string buttonid, readonly string buttontext, readonly string buttondata, readonly integer popx, readonly integer popy);CHOOSE CASE buttonid
   CASE BACK_BUTTON
      IF ISVALID(inv_nav) THEN inv_nav.of_PopMenuBack(popx, popy)
   CASE FORWARD_BUTTON
      IF ISVALID(inv_nav) THEN inv_nav.of_PopMenuForward(popx, popy)
   CASE CLOSE_BUTTON
      str_menuitem lstr[]
      
      lstr[1].menutext = "Close All Modules"
      lstr[1].subscriber = this
      lstr[1].eventname = "ke_closeallmodules"
      
      n_svc_mgr lnv_svc
      n_svc_menu lnv_m
      
      lnv_svc.of_LoadSvc(lnv_m, CSvc.MENU)
      
      lnv_m.of_createmenu(lstr, popx, popy)
END CHOOSE
end event

event type integer ke_closeallmodules();long ll_count, n
dragobject ldo
integer li_index

ll_count = UPPERBOUND(istr_modules)
iuo_sheets.of_SuspendRefresh()

IF FORCE_CLOSE THEN
   iuo_sheets.of_CloseAllTabs()
   RETURN CRet.SUCCESS
END IF

FOR n = ll_count to 1 STEP -1
   IF n = 1 THEN CONTINUE
   IF NOT ISVALID(istr_modules[n].object) THEN CONTINUE
   IF NOT istr_modules[n].object.EVENT ke_canclose() THEN
      iuo_sheets.of_Selecttab(istr_modules[n].object)
      iuo_sheets.of_ResumeRefresh()
      IF istr_modules[n].object.EVENT ke_explorer_closequery() = CRet.FAILURE THEN
         //stop closing
         RETURN CRet.FAILURE
      ELSE
         iuo_sheets.of_suspendrefresh()
                  
         li_index = of_GetObjectIndex(istr_modules[n].object)
         
         IF li_index > 0 THEN
            iuo_sheets.of_Closetab(li_index, FALSE)
         END IF
      END IF
   ELSE
      li_index = of_GetObjectIndex(istr_modules[n].object)
      
      IF li_index > 0 THEN
         iuo_sheets.of_Closetab(li_index, FALSE)
      END IF      
   END IF
NEXT

iuo_sheets.of_Selecttab(1)
iuo_sheets.of_ResumeRefresh()

RETURN CRet.SUCCESS
end event

event type boolean ke_canclosemodule();IF NOT ISVALID(iuo_current_explorer) THEN RETURN TRUE

RETURN iuo_current_explorer.EVENT ke_canclose()
end event

event ke_closemodule();IF iuo_current_explorer.EVENT ke_explorer_closequery() <> CRet.FAILURE THEN
   iuo_sheets.of_CloseTab(iuo_sheets.of_GetSelectedIndex())
END IF

IF ISVALID(itv) THEN
   IF NOT itv.Enabled THEN 
      POST of_Lockcontrols(FALSE)
   END IF
END IF
end event

event ke_maxtabsreached();MessageBox("Warning", "There are too many open modules. " + &
            "To conserve on memory, please close active modules.", &
            Exclamation!)
end event

event ke_tvselectionchanging;long ll_ret

IF NOT ib_fromtabselection THEN
   //max tabs opened
   IF iuo_sheets.of_GetTabCount() >= iuo_sheets.#MaxTabs THEN
      EVENT ke_maxtabsreached()
      RETURN 1
   END IF
END IF

ib_fromtabselection = FALSE

IF ISVALID(iuo_current_explorer) THEN
   ll_ret = iuo_current_explorer.EVENT ke_explorer_selectionchanging()
   //must return 1 to prevent treeview selection
   IF ll_ret = CRet.FAILURE THEN 
      ll_ret = 1
   ELSE
      ll_ret = CRet.NO_ACTION
   END IF
END IF

RETURN ll_ret
end event

event ke_tvselectionchanged(readonly integer oldhandle, readonly integer newhandle);long ll_row
u_explorer luo_x
treeviewitem ltvi

itv.GetItem(newhandle, ltvi)
luo_x = of_Openmodule(newhandle)

luo_x.EVENT ke_explorer_activate()

//title
string ls_title

ls_title = luo_x.EVENT ke_overridetitle()
IF ls_title = CString.EMPTY THEN
   
   ls_title = ltvi.Label
END IF

//strip edit
long ll_pos

ll_pos = POS(ls_title, " (*)")
IF ll_pos > 0 THEN &
   ls_title = TRIM(MID(ls_title, 1, ll_pos))
   
IF ISVALID(iuo_title) THEN 
   iuo_title.uo_gradient.of_SetText(ls_title)
   iuo_title.uo_gradient.of_SetIcon(ltvi.SelectedPictureIndex, FALSE)
END IF

//set active
iuo_current_explorer = luo_x

//toggle states
boolean lb
lb = EVENT ke_canclosemodule()

//add to nav
IF ISVALID(inv_nav) THEN
   inv_nav.of_SelectionChanged(oldhandle, newhandle)
END IF
//toolbar
IF ISVALID(iuo_dwtoolbar) THEN
   iuo_dwtoolbar.of_ButtonEnable(BACK_BUTTON, inv_nav.of_getbackcount() > 0)
   iuo_dwtoolbar.of_ButtonEnable(FORWARD_BUTTON, inv_nav.of_getforwardcount() > 0)
   iuo_dwtoolbar.of_ButtonEnable(CLOSE_BUTTON, lb)
END IF

//check editmode
long ll

ll = of_GetObjectIndex(iuo_current_explorer)
of_SetMode(iuo_current_explorer, istr_modules[ll].mode)

//statusbar
IF ISVALID(iuo_statusbar) THEN
   IF NOT iuo_current_explorer.EVENT ke_overridestatusbar(iuo_statusbar) THEN
      iuo_statusbar.of_SetLayout(1)
      iuo_statusbar.of_settext(1, iuo_current_explorer.EVENT ke_getstatustext())
   END IF
END IF

//title
IF ISVALID(iuo_title) THEN
   iuo_title.of_ShowX(lb)
END IF

end event

event type integer ke_tabselectionchanging(readonly integer oldindex, readonly integer newindex);dragobject ldo
integer li_index

ldo = iuo_sheets.of_GetObject(newindex)
li_index = of_GetObjectIndex(ldo)

IF li_index > 0 THEN
   ib_fromtabselection = TRUE
   RETURN itv.SelectItem(istr_modules[li_index].itemhandle)
END IF

RETURN CRet.SUCCESS
end event

event type boolean ke_canclosetab(readonly integer ai_index);RETURN TRUE
end event

event ke_moduleopened(readonly string as_classname, readonly string as_title);//fired when module opened succesfully
end event

public subroutine of_uponefolder ();long ll_current, ll_parent

IF NOT ISVALID(itv) THEN RETURN

ll_current = itv.FindItem(CurrentTreeItem!, 0)
IF ll_current > 0 THEN
   ll_parent = itv.FindItem(ParentTreeItem!, ll_current)
   IF ll_parent > 0 THEN itv.SelectItem(ll_parent)
END IF
end subroutine

public subroutine of_showtreepane (readonly boolean ab_show);IF ISVALID(iuo_splitter) THEN
   IF ab_show THEN
      iuo_splitter.of_showsplitpart(0)
   ELSE
      iuo_splitter.of_showsplitpart(2)
   END IF
END IF

IF ISVALID(iuo_dwtoolbar) THEN &
   iuo_dwtoolbar.of_buttoncheck(FOLDER_BUTTON, ab_show)
end subroutine

public function integer of_getobjectindex (readonly dragobject ado);integer li_ret
long ll_count, n

li_ret = CRet.FAILURE

ll_count = UPPERBOUND(istr_modules)
FOR n = 1 to ll_count
   IF istr_modules[n].object = ado THEN 
      li_ret = n
      EXIT
   END IF
NEXT

RETURN li_ret
end function

protected function integer of_getavailableindex ();long ll_count, n

ll_count = UPPERBOUND(istr_modules)
FOR n = 1 to ll_count
   IF NOT ISVALID(istr_modules[n].object) THEN RETURN n
NEXT

RETURN ll_count + 1
end function

public function u_statusbar_explorer of_getexplorerstatusbar ();RETURN iuo_statusbar
end function

public function u_border_explorer of_getexplorertitle ();RETURN iuo_title
end function

public function u_tv_explorer of_getexplorertreeview ();RETURN itv
end function

public function u_dwtb_explorer of_getexplorertoolbar ();RETURN iuo_dwtoolbar
end function

public function u_sheets_explorer of_getexplorersheets ();RETURN iuo_sheets
end function

public function u_splitcontainer_explorer of_getexplorersplitter ();RETURN iuo_splitter
end function

public subroutine of_registertreeview (readonly u_tv_explorer atv);itv = atv

IF ISVALID(itv) THEN itv.of_SetExplorer(this)
end subroutine

public subroutine of_registertitlebar (readonly u_border_explorer auo_titlebar);iuo_title = auo_titlebar

IF ISVALID(iuo_title) THEN 
   iuo_title.of_SetExplorer(this)
   //set imagelist
   n_svc_mgr lnv_svc
   n_svc_resource lnv_r
   
   lnv_svc.of_LoadSvc(lnv_r, CSvc.RESOURCE)
   iuo_title.of_SetHeaderImagelist( &
      lnv_r.of_GetStandardImagelist16(lnv_svc), 16)
END IF
end subroutine

public subroutine of_registerstatusbar (readonly u_statusbar_explorer auo_statusbar);iuo_statusbar = auo_statusbar

IF ISVALID(iuo_statusbar) THEN iuo_statusbar.of_SetExplorer(this)
end subroutine

public subroutine of_registersplitter (readonly u_splitcontainer_explorer auo_splitter);iuo_splitter = auo_splitter

IF ISVALID(iuo_splitter) THEN 
   iuo_splitter.of_SetExplorer(this)
   //toolbar?
   IF ISVALID(iuo_dwtoolbar) THEN
      iuo_dwtoolbar.of_ButtonCheck(FOLDER_BUTTON, iuo_splitter.#ShowPart = 0)
   END IF
END IF
end subroutine

public subroutine of_registersheets (readonly u_sheets_explorer auo_sheets);iuo_sheets = auo_sheets

IF ISVALID(iuo_sheets) THEN iuo_sheets.of_SetExplorer(this)
end subroutine

public subroutine of_registertoolbar (readonly u_dwtb_explorer auo_toolbar);iuo_dwtoolbar = auo_toolbar

IF ISVALID(iuo_dwtoolbar) THEN 
   iuo_dwtoolbar.of_SetExplorer(this)
   //we have a toolbar, create a navigator
   IF ISVALID(inv_nav) THEN DESTROY inv_nav
   inv_nav = CREATE n_explorer_navigator
   //set tv and maximum list
   inv_nav.of_Register(itv)
   inv_nav.of_SetMaxlist(#MaxList)
END IF
end subroutine

public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_dwtb_explorer auo_toolbar, readonly u_splitcontainer_explorer auo_splitter, readonly u_border_explorer auo_titlebar, readonly u_statusbar_explorer auo_statusbar);//register
of_RegisterTreeview(atv)
of_RegisterSheets(auo_sheets)
of_RegisterToolbar(auo_toolbar)
of_RegisterSplitter(auo_splitter)
of_RegisterTitlebar(auo_titlebar)
of_RegisterStatusbar(auo_statusbar)
end subroutine

public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_dwtb_explorer auo_toolbar, readonly u_splitcontainer_explorer auo_splitter, readonly u_border_explorer auo_titlebar);//register
of_RegisterTreeview(atv)
of_RegisterSheets(auo_sheets)
of_RegisterToolbar(auo_toolbar)
of_RegisterSplitter(auo_splitter)
of_RegisterTitlebar(auo_titlebar)
end subroutine

public subroutine of_lockcontrols (readonly boolean ab_lock);IF ISVALID(itv) THEN itv.Enabled = NOT ab_lock
IF ISVALID(iuo_sheets) THEN iuo_sheets.of_locktab(ab_lock)
end subroutine

public function integer of_cleanup ();long ll_count, n

IF EVENT ke_closeallmodules() = CRet.FAILURE THEN RETURN CRet.FAILURE
//close folder tab
iuo_sheets.of_CloseTab(1, FALSE)

RETURN CRet.SUCCESS
end function

public function integer of_focuscurrentmodule ();IF ISVALID(iuo_current_explorer) THEN
   iuo_current_explorer.SetFocus()
   iuo_current_explorer.EVENT ke_explorer_gotfocus()
   RETURN CRet.SUCCESS
ELSE
   RETURN CRet.FAILURE
END IF
end function

public subroutine of_forceclose ();FORCE_CLOSE = TRUE
end subroutine

public function u_explorer of_openmodule (readonly long al_itemhandle);string ls_classname, ls_tabtext, ls_tvitext
u_explorer luo_x
long ll_count, n, ll_row
boolean lb_exists, lb_static, lb_open
treeviewitem ltvi
long ll_node

//get row from row id
itv.GetItem(al_itemhandle, ltvi)
ls_tvitext = ltvi.Label
//bugfix for edit mode
IF POS(ls_tvitext, " (*)") > 0 THEN
   ls_tvitext = MID(ls_tvitext, 1, LEN(ls_tvitext) - 4)
END IF

ll_row = ids_modules.GetRowFromRowID(LONG(ltvi.Data))

ls_classname = ids_modules.GetItemString(ll_row, "classname")
ls_tabtext = ids_modules.GetItemString(ll_row, "tabtext")
ll_node = ids_modules.GetItemNumber(ll_row, "node")

ll_count = UPPERBOUND(istr_modules)

//locate class and determine if static
FOR n = 1 to ll_count
   IF istr_modules[n].classname = ls_classname THEN
      IF ISVALID(istr_modules[n].object) THEN
         lb_static = istr_modules[n].object.#StaticClass
         EXIT
      END IF
   END IF
NEXT

IF lb_static THEN
   FOR n = 1 to ll_count
      IF istr_modules[n].classname = ls_classname THEN
         lb_exists = TRUE
         EXIT
      END IF
   NEXT
ELSE
   FOR n = 1 to ll_count
      IF istr_modules[n].displayname = ls_tvitext AND &
         istr_modules[n].classname = ls_classname THEN
         
         //is the object still valid?
         IF ISVALID(istr_modules[n].object) THEN
            lb_exists = TRUE
            EXIT
         END IF
      END IF
   NEXT
END IF

IF NOT lb_exists THEN
   SetPointer(Hourglass!)
   n = of_GetAvailableIndex()
   istr_modules[n].Displayname = ltvi.Label
   istr_modules[n].Classname = ls_classname
   IF ls_tabtext = CString.EMPTY OR ISNULL(ls_tabtext) THEN
      ls_tabtext = ltvi.Label
   END IF
   
   ClassDefinition lcd
   
   lcd = FindClassDefinition(ls_classname)
   
   IF ISVALID(iuo_statusbar) THEN &
      iuo_statusbar.of_Settext(1, "Opening module " + ls_tabtext + "...")
   
   IF ISNULL(lcd) OR NOT ISVALID(lcd) THEN
      istr_modules[n].object = iuo_sheets.of_Opentab(ls_tabtext, "u_explorer_invalid")
   ELSE
      istr_modules[n].object = iuo_sheets.of_Opentab(ls_tabtext, ls_classname)
      lb_open = TRUE
   END IF
   //register explorer and node
   istr_modules[n].object.of_register(this, ll_node)
END IF

//do not fire tab events
iuo_sheets.of_SuspendEvents(TRUE)
iuo_sheets.of_SelectTab(istr_modules[n].object)
iuo_sheets.of_SuspendEvents(FALSE)

//set the itemhandle
istr_modules[n].itemhandle = ltvi.itemhandle

//notify module opened
IF lb_open THEN
   EVENT ke_moduleopened(ls_classname, ls_tabtext)
END IF

SetPointer(Arrow!)

RETURN istr_modules[n].object
end function

public subroutine of_setmode (readonly u_explorer auo, readonly integer ai_mode);long ll_index
long ll_pos

ll_index = of_GetObjectIndex(auo)
IF ll_index <= 0 THEN RETURN

istr_modules[ll_index].mode = ai_mode
//treeviewitem
treeviewitem ltvi

itv.GetItem(istr_modules[ll_index].itemhandle, ltvi)
ltvi.Bold = ai_mode <> CMode.NORMAL
//ltvi.Label = istr_modules[ll_index].displayname

ll_pos = POS(ltvi.Label, " (*)")
IF ai_mode <> CMode.NORMAL THEN
   IF ll_pos <= 0 THEN &
      ltvi.Label += " (*)"
ELSE
   IF ll_pos > 0 THEN &
      ltvi.Label = TRIM(MID(ltvi.Label, 1, ll_pos))
END IF
itv.SetItem(istr_modules[ll_index].itemhandle, ltvi)

//if active object
//IF ISVALID(iuo_current_explorer) THEN
// IF iuo_current_explorer = istr_modules[ll_index].object THEN
//    Application.of_mode(ai_mode)
// END IF
//END IF
end subroutine

public subroutine of_setmodules (readonly n_ds ads);ads.of_clone(ids_modules)
end subroutine

public function integer of_populatemodules ();n_svc_tv lnv_tv
n_svc_mgr lnv_svc

IF NOT ISVALID(ids_modules) THEN RETURN CRet.FAILURE

lnv_svc.of_LoadSvc(lnv_tv, CSvc.TV)
lnv_tv.of_ConvertDatastore(lnv_svc, &
            ids_modules, &
            itv, &
            0, &
            "parentnode", &
            "-1", &
            "node", &
            "displaytext", &
            "<#row_id#>", &
            "sortorder", &
            "pictureindex", &
            "selectedpictureindex", &
            CString.EMPTY, &
            "expanded")

//select root item
itv.SelectItem(1)

RETURN CRet.SUCCESS
end function

public subroutine of_setmodules (readonly string ads);n_ds lds

lds = CREATE n_ds
lds.of_SetDataobject(ads)
of_SetModules(lds)
DESTROY lds
end subroutine

public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets);//register
of_RegisterTreeview(atv)
of_RegisterSheets(auo_sheets)
end subroutine

public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_splitcontainer_explorer auo_splitter);//register
of_RegisterTreeview(atv)
of_RegisterSheets(auo_sheets)
of_RegisterSplitter(auo_splitter)
end subroutine

public function string of_getclassnamefromnode (readonly long nodeid);string ls_ret
long ll

ll = ids_modules.Find("node=" + STRING(nodeid), 1, ids_modules.RowCount())

IF ll > 0 THEN
   ls_ret = ids_modules.GetItemString(ll, "classname")
END IF

RETURN ls_ret
end function

public subroutine of_register (readonly u_tv_explorer atv, readonly u_sheets_explorer auo_sheets, readonly u_dwtb_explorer auo_toolbar, readonly u_splitcontainer_explorer auo_splitter);//register
of_RegisterTreeview(atv)
of_RegisterSheets(auo_sheets)
of_RegisterToolbar(auo_toolbar)
of_RegisterSplitter(auo_splitter)
end subroutine

on n_explorer.create
call super::create
end on

on n_explorer.destroy
call super::destroy
end on

event destructor;call super::destructor;IF ISVALID(inv_nav) THEN DESTROY inv_nav
end event

event constructor;call super::constructor;n_svc_mgr lnv_svc
n_svc_isempty lnv_check

lnv_svc.of_LoadSvc(lnv_check, CSvc.ISEMPTY)
IF NOT lnv_check.of_IsEmpty(#ModuleDatastore) THEN
   of_SetModules(#ModuleDatastore)
END IF
end event