Ejemplo n.º 1
0
//---------------------------------------------------------
void CWKSP_Module_Manager::_Config_Read(void)
{
    bool		bValue;
    long		lValue;
    wxString	sValue;

    if( CONFIG_Read(wxT("/MODULES"), wxT("BEEP")		, bValue) )
    {
        m_Parameters("BEEP")		->Set_Value(bValue);
    }

    if( CONFIG_Read(wxT("/MODULES"), wxT("START_LOGO")	, lValue) )
    {
        m_Parameters("START_LOGO")	->Set_Value((int)lValue);
    }

    if( CONFIG_Read(wxT("/MODULES"), wxT("PROC_FREQ")	, lValue) )
    {
        m_Parameters("PROC_FREQ")	->Set_Value((int)lValue);
    }

    for(int i=0; CONFIG_Read(CFG_LIBS, wxString::Format(CFG_LIBF, i), sValue); i++)
    {
        Open(sValue);
    }

    m_pMenu->Update();
}
Ejemplo n.º 2
0
//---------------------------------------------------------
void CSAGA_Frame::Show_Tips(bool bShow)
{
	bool			bTip;
	long			iTip;

#ifdef SHARE_PATH
        wxFileName      fTip(wxT(SHARE_PATH), wxT("saga_tip.txt"));
#else
        wxFileName      fTip(g_pSAGA->Get_App_Path(), wxT("saga_gui"), wxT("tip"));
#endif

	wxTipProvider	*pTip;

	bTip	= CONFIG_Read(wxT("/TIPS"), wxT("ATSTART"), bTip) ? bTip : true;

	if( bShow || (bTip && fTip.FileExists()) )
	{
		iTip	= CONFIG_Read(wxT("/TIPS"), wxT("CURRENT"), iTip) ? iTip : 0;
		pTip	= wxCreateFileTipProvider(fTip.GetFullPath(), iTip);

		bTip	= wxShowTip(this, pTip, bTip);
		iTip	= pTip->GetCurrentTip();

		CONFIG_Write(wxT("/TIPS"), wxT("ATSTART"), bTip);
		CONFIG_Write(wxT("/TIPS"), wxT("CURRENT"), iTip);

		delete(pTip);
	}
}
Ejemplo n.º 3
0
//---------------------------------------------------------
void CWKSP::Add_Pages(void)
{
	long	lValue;

	//-----------------------------------------------------
	AddPage(m_pTools            , _TL("Tools"), false, IMG_TOOLS);
	AddPage(m_pData->GetParent(), _TL("Data" ), false, IMG_DATA );
	AddPage(m_pMaps->GetParent(), _TL("Maps" ), false, IMG_MAPS );

	if( CONFIG_Read("/DATA", "TAB", lValue) )
	{
		SetSelection((size_t)lValue);
	}

	//-----------------------------------------------------
	((wxNotebook *)m_pData->GetParent())->AddPage(m_pData			, SUBNB_CAPTION_TREE	, false, 0);
	((wxNotebook *)m_pData->GetParent())->AddPage(m_pData_Buttons	, SUBNB_CAPTION_BUTTONS	, false, 1);

	if( CONFIG_Read("/DATA/BUTTONS", "TAB", lValue) )
	{
		((wxNotebook *)m_pData->GetParent())->SetSelection((size_t)lValue);
	}

	//-----------------------------------------------------
	((wxNotebook *)m_pMaps->GetParent())->AddPage(m_pMaps			, SUBNB_CAPTION_TREE	, false, 0);
	((wxNotebook *)m_pMaps->GetParent())->AddPage(m_pMaps_Buttons	, SUBNB_CAPTION_BUTTONS	, false, 1);

	if( CONFIG_Read("/MAPS/BUTTONS", "TAB", lValue) )
	{
		((wxNotebook *)m_pMaps->GetParent())->SetSelection((size_t)lValue);
	}
}
Ejemplo n.º 4
0
//---------------------------------------------------------
bool		DLG_Open(wxArrayString &File_Paths, const wxString &Caption, const wxString &def_Dir, const wxString &Filter)
{
	wxString	Dir(def_Dir);

	if( !wxDirExists(def_Dir) )
	{
		CONFIG_Read(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(-1), Dir);
	}

	wxFileDialog	dlg(MDI_Get_Top_Window(), Caption, Dir, wxT(""), Filter, wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_MULTIPLE);

	if( dlg.ShowModal() == wxID_OK )
	{
		dlg.GetPaths(File_Paths);

		if( File_Paths.GetCount() > 0 )
		{
			if( !wxDirExists(def_Dir) )
			{
				CONFIG_Write(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(-1), SG_File_Get_Path(File_Paths[0]).w_str());
			}

			return( true );
		}
	}

	return( false );
}
Ejemplo n.º 5
0
//---------------------------------------------------------
bool		DLG_Open(wxString &File_Path, const wxString &Caption, const wxString &def_Dir, const wxString &def_File, const wxString &Filter)
{
	wxString	Dir(def_Dir);

	if( !wxDirExists(def_Dir) )
	{
		CONFIG_Read(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(-1), Dir);
	}

	wxFileDialog	dlg(MDI_Get_Top_Window(), Caption, Dir, def_File, Filter, wxFD_OPEN|wxFD_FILE_MUST_EXIST);

	if( dlg.ShowModal() == wxID_OK )
	{
		File_Path	= dlg.GetPath();

		if( !wxDirExists(def_Dir) )
		{
			CONFIG_Write(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(-1), SG_File_Get_Path(File_Path).w_str());
		}

		return( true );
	}

	return( false );
}
//---------------------------------------------------------
void CData_Source_PgSQL::Autoconnect(void)
{
	long Reopen	= 0;

	CONFIG_Read("/DATA", "PROJECT_DB_REOPEN", Reopen);

	if( Reopen != 0 )
	{
		wxTreeItemIdValue srvCookie; wxTreeItemId srvItem = GetFirstChild(GetRootItem(), srvCookie);

		while( srvItem.IsOk() )
		{
			wxTreeItemIdValue Cookie; wxTreeItemId Item = GetFirstChild(srvItem, Cookie);

			while( Item.IsOk() )
			{
				CData_Source_PgSQL_Data	*pData	= Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL )	return;

				if( pData->Get_Type() == TYPE_SOURCE && !pData->Get_Username().is_Empty() )
				{
					Source_Open(pData, false);
				}

				Item	= GetNextChild(Item, Cookie);
			}

			srvItem	= GetNextChild(srvItem, srvCookie);
		}
	}
}
Ejemplo n.º 7
0
//---------------------------------------------------------
bool		DLG_Image_Save(wxString &File_Path, int &Type, const wxString &def_Dir, const wxString &def_File)
{
	static	int	Filter_Index	= 3;

	wxString	Dir(def_Dir);

	if( !wxDirExists(def_Dir) )
	{
		CONFIG_Read(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(-1), Dir);
	}

	wxFileDialog	dlg(
		MDI_Get_Top_Window(), _TL("Save As Image"), Dir, def_File, wxString::Format(
			"%s (*.bmp)|*.bmp|"
			"%s (*.jpg)|*.jpg;*.jif;*.jpeg|"
			"%s (*.tif)|*.tif;*.tiff|"
			"%s (*.png)|*.png|"
			"%s (*.gif)|*.gif|"
			"%s (*.pcx)|*.pcx",
			_TL("Windows or OS/2 Bitmap"),
			_TL("JPEG - JFIF Compliant"),
			_TL("Tagged Image File Format"),
			_TL("Portable Network Graphics"),
			_TL("CompuServe Graphics Interchange"),
			_TL("Zsoft Paintbrush")
		), wxFD_SAVE|wxFD_OVERWRITE_PROMPT
	);

	dlg.SetFilterIndex(Filter_Index);

	if( dlg.ShowModal() == wxID_OK )
	{
		File_Path		= dlg.GetPath();
		Filter_Index	= dlg.GetFilterIndex();

		switch( Filter_Index )
		{
		default: Type	= wxBITMAP_TYPE_BMP ;	break;
		case  1: Type	= wxBITMAP_TYPE_JPEG;	break;
		case  2: Type	= wxBITMAP_TYPE_TIF ;	break;
		case  3: Type	= wxBITMAP_TYPE_PNG ;	break;
		case  4: Type	= wxBITMAP_TYPE_GIF ;	break;
 		case  5: Type	= wxBITMAP_TYPE_PCX ;	break;
		case  6: Type	= wxBITMAP_TYPE_PNM ;	break;
		}

		if( !wxDirExists(def_Dir) )
		{
			CONFIG_Write(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(-1), SG_File_Get_Path(File_Path).w_str());
		}

		return( true );
	}

	return( false );
}
//---------------------------------------------------------
bool CWKSP_Module_Manager::Initialise(void)
{
	CONFIG_Read("/MODULES", &m_Parameters);

	CONFIG_Do_Save(m_Parameters("SAVE_CONFIG")->asBool());

	g_pSAGA->Process_Set_Frequency(m_Parameters("PROCESS_UPDATE")->asInt());

#ifdef _OPENMP
	SG_OMP_Set_Max_Num_Threads(m_Parameters("OMP_THREADS_MAX")->asInt());
#endif

	//-----------------------------------------------------
	wxString	Library;

	for(int i=0; CONFIG_Read(CFG_LIBS, wxString::Format(CFG_LIBF, i), Library); i++)
	{
		if( !wxFileExists(Library) )
		{
			wxFileName	fn(Library);	fn.MakeAbsolute(g_pSAGA->Get_App_Path());

			Library	= fn.GetFullPath();
		}

		SG_Get_Module_Library_Manager().Add_Library(Library);
	}

	if( SG_Get_Module_Library_Manager().Get_Count() == 0 )
	{
#if defined(_SAGA_LINUX)
	if( (SG_Get_Module_Library_Manager().Add_Directory(CSG_String(MODULE_LIBRARY_PATH), false)
	   + SG_Get_Module_Library_Manager().Add_Directory(SG_File_Make_Path(CSG_String(SHARE_PATH), SG_T("toolchains")), false)) == 0 )
#endif
		SG_Get_Module_Library_Manager().Add_Directory(g_pSAGA->Get_App_Path(), true);
	}

	_Update(false);

	return( true );
}
Ejemplo n.º 9
0
bool		DLG_Open(wxArrayString &File_Paths, int ID_DLG)
{
	wxString	def_Dir;

	CONFIG_Read(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(ID_DLG), def_Dir);

	if( DLG_Open(File_Paths, DLG_Get_FILE_Caption(ID_DLG), def_Dir, DLG_Get_FILE_Filter(ID_DLG)) )
	{
		CONFIG_Write(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(ID_DLG), SG_File_Get_Path(File_Paths[0]).w_str());

		return( true );
	}

	return( false );
}
//---------------------------------------------------------
CData_Source_PgSQL::CData_Source_PgSQL(wxWindow *pParent)
	: wxTreeCtrl(pParent, ID_WND_DATA_SOURCE_DATABASE)
{
	AssignImageList(new wxImageList(IMG_SIZE_TREECTRL, IMG_SIZE_TREECTRL, true, 0));
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCES    );	// IMG_ROOT
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCES    );	// IMG_SERVER
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCE_OFF );	// IMG_SRC_CLOSED
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCE_ON  );	// IMG_SRC_OPENED
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_TABLE      );	// IMG_TABLE
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POINT  );	// IMG_POINT
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POINTS );	// IMG_POINTS
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_LINE   );	// IMG_LINE
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POLYGON);	// IMG_POLYGON
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_GRID_MANAGER  );	// IMG_GRIDS
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_GRID          );	// IMG_GRID

	AddRoot(_TL("PostgreSQL Sources"), IMG_ROOT, IMG_ROOT, new CData_Source_PgSQL_Data(TYPE_ROOT));

	//-----------------------------------------------------
	SG_UI_Msg_Lock(true);

	wxString	Server;

	for(int i=0; CONFIG_Read(CFG_PGSQL_DIR, wxString::Format(CFG_PGSQL_SRC, i), Server); i++)
	{
		wxString	User, Password;

		if( Server.Find("|") > 0 )
		{
			User     = Server.AfterFirst ('|').BeforeFirst('|');
			Password = Server.AfterLast  ('|');
			Server   = Server.BeforeFirst('|');
		}

		CData_Source_PgSQL_Data	*pData	= new CData_Source_PgSQL_Data(TYPE_SOURCE, &Server, &Server, &User, &Password);

		Update_Source(AppendItem(Get_Server_Item(Server, true), pData->Get_DBName().c_str(), IMG_SRC_CLOSED, IMG_SRC_CLOSED, pData));
	}

	Update_Sources();

	SG_UI_Msg_Lock(false);
}
Ejemplo n.º 11
0
bool		DLG_Save(wxString &File_Path, int ID_DLG)
{
	wxString	def_Dir, def_Name;

	def_Name	= SG_File_Get_Name(File_Path, true).w_str();
	def_Dir		= SG_File_Get_Path(File_Path).w_str();

	if( !wxDirExists(def_Dir) )
	{
		CONFIG_Read(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(ID_DLG), def_Dir);
	}

	if( DLG_Save(File_Path, DLG_Get_FILE_Caption(ID_DLG), def_Dir, def_Name, DLG_Get_FILE_Filter(ID_DLG)) )
	{
		CONFIG_Write(CONFIG_GROUP_FILE_DLG, DLG_Get_FILE_Config(ID_DLG), SG_File_Get_Path(File_Path).w_str());

		return( true );
	}

	return( false );
}
//---------------------------------------------------------
CData_Source_PgSQL::~CData_Source_PgSQL(void)
{
	long Reopen	= 0;

	CONFIG_Read("/DATA", "PROJECT_DB_REOPEN", Reopen);

	CONFIG_Delete(CFG_PGSQL_DIR);

	wxTreeItemIdValue srvCookie; wxTreeItemId srvItem = GetFirstChild(GetRootItem(), srvCookie);

	for(int i=0; srvItem.IsOk(); )
	{
		wxTreeItemIdValue Cookie; wxTreeItemId Item = GetFirstChild(srvItem, Cookie);

		while( Item.IsOk() )
		{
			CData_Source_PgSQL_Data	*pData	= (CData_Source_PgSQL_Data *)GetItemData(Item);

			if( pData && pData->Get_Type() == TYPE_SOURCE )
			{
				CSG_String	Connection	= pData->Get_Server().c_str();

				if( Reopen != 0 && pData->is_Connected() && !pData->Get_Username().is_Empty() )	// store user and password
				{
					Connection	+= "|" + pData->Get_Username() + "|" + pData->Get_Password();
				}

				CONFIG_Write(CFG_PGSQL_DIR, wxString::Format(CFG_PGSQL_SRC, i++), Connection.c_str());
			}

			Item	= GetNextChild(Item, Cookie);
		}

		srvItem	= GetNextChild(srvItem, srvCookie);
	}
}
//---------------------------------------------------------
wxMenu * CWKSP_Data_Menu_File::Create(TSG_Data_Object_Type DataType)
{
	Destroy();

	m_DataType	= DataType;

	//-----------------------------------------------------
	switch( m_DataType )
	{
	default:
		m_Recent_First	= 0;
		m_Recent_Count	= 0;
		m_Recent_Group	= wxT("");
		break;

	case DATAOBJECT_TYPE_Undefined:
		m_Recent_First	= ID_CMD_DATA_PROJECT_RECENT_FIRST;
		m_Recent_Count	= ID_CMD_DATA_PROJECT_RECENT_LAST   - m_Recent_First + 1;
		m_Recent_Group	= wxT("Projects");
		break;

	case DATAOBJECT_TYPE_Table:
		m_Recent_First	= ID_CMD_TABLES_RECENT_FIRST;
		m_Recent_Count	= ID_CMD_TABLES_RECENT_LAST - m_Recent_First + 1;
		m_Recent_Group	= wxT("Tables");
		break;

	case DATAOBJECT_TYPE_Shapes:
		m_Recent_First	= ID_CMD_SHAPES_RECENT_FIRST;
		m_Recent_Count	= ID_CMD_SHAPES_RECENT_LAST - m_Recent_First + 1;
		m_Recent_Group	= wxT("Shapes");
		break;

	case DATAOBJECT_TYPE_TIN:
		m_Recent_First	= ID_CMD_TIN_RECENT_FIRST;
		m_Recent_Count	= ID_CMD_TIN_RECENT_LAST    - m_Recent_First + 1;
		m_Recent_Group	= wxT("TIN");
		break;

	case DATAOBJECT_TYPE_PointCloud:
		m_Recent_First	= ID_CMD_POINTCLOUD_RECENT_FIRST;
		m_Recent_Count	= ID_CMD_POINTCLOUD_RECENT_LAST    - m_Recent_First + 1;
		m_Recent_Group	= wxT("Point Cloud");
		break;

	case DATAOBJECT_TYPE_Grid:
		m_Recent_First	= ID_CMD_GRIDS_RECENT_FIRST;
		m_Recent_Count	= ID_CMD_GRIDS_RECENT_LAST  - m_Recent_First + 1;
		m_Recent_Group	= wxT("Grids");
		break;
	}

	if( m_Recent_Count > 0 )
	{
		m_Recent		= new wxString[m_Recent_Count];

		for(int i=0; i<m_Recent_Count; i++)
		{
			CONFIG_Read(wxString::Format(wxT("RECENT_FILES/%s"), m_Recent_Group.c_str()), wxString::Format(wxT("FILE_%02d"), i + 1), m_Recent[i]);
		}
	}

	//-----------------------------------------------------
	wxMenu	*pMenu	= new wxMenu;

	Update(pMenu);

	return( pMenu );
}
Ejemplo n.º 14
0
//---------------------------------------------------------
CWKSP_Map_Manager::CWKSP_Map_Manager(void)
{
	g_pMaps		= this;

	//-----------------------------------------------------
	CSG_Parameter	*pNode, *pNode_1;

	//-----------------------------------------------------
	pNode	= m_Parameters.Add_Node(NULL, "NODE_DEFAULTS", _TL("Defaults for New Maps"), _TL(""));

	m_Parameters.Add_Value(
		pNode	, "GOTO_NEWLAYER"	, _TL("Zoom to added layer"),
		_TL(""),
		PARAMETER_TYPE_Bool, true
	);

	m_Parameters.Add_Value(
		pNode	, "SCALE_BAR"		, _TL("Show Scale Bar"),
		_TL(""),
		PARAMETER_TYPE_Bool, true
	);

	//-----------------------------------------------------
	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_FRAME", _TL("Frame"), _TL(""));

	m_Parameters.Add_Value(
		pNode_1	, "FRAME_SHOW"		, _TL("Show"),
		_TL(""),
		PARAMETER_TYPE_Bool, true
	);

	m_Parameters.Add_Value(
		pNode_1	, "FRAME_WIDTH"		, _TL("Width"),
		_TL(""),
		PARAMETER_TYPE_Int, 17, 5, true
	);

	//-----------------------------------------------------
	pNode	= m_Parameters.Add_Node(NULL, "NODE_CLIPBOARD", _TL("Clipboard"), _TL(""));

	m_Parameters.Add_Value(
		pNode	, "CLIP_NX"			, _TL("Width"),
		_TL(""),
		PARAMETER_TYPE_Int, 400, 10, true
	);

	m_Parameters.Add_Value(
		pNode	, "CLIP_NY"			, _TL("Height"),
		_TL(""),
		PARAMETER_TYPE_Int, 400, 10, true
	);

	m_Parameters.Add_Value(
		pNode	, "CLIP_FRAME"		, _TL("Frame Width"),
		_TL(""),
		PARAMETER_TYPE_Int, 17, 0, true
	);

	//-----------------------------------------------------
	pNode_1	= m_Parameters.Add_Node(pNode, "NODE_CLIP_LEGEND", _TL("Legend"), _TL(""));

	m_Parameters.Add_Value(
		pNode_1	, "CLIP_LEGEND_SCALE", _TL("Scale"),
		_TL(""),
		PARAMETER_TYPE_Double, 2.0, 1.0, true
	);

	m_Parameters.Add_Value(
		pNode_1	, "CLIP_LEGEND_FRAME", _TL("Frame Width"),
		_TL(""),
		PARAMETER_TYPE_Int, 10, 0, true
	);

	m_Parameters.Add_Value(
		pNode_1	, "CLIP_LEGEND_COLOR", _TL("Border Color"),
		_TL(""),
		PARAMETER_TYPE_Color, SG_GET_RGB(0, 0, 0)
	);

	//-----------------------------------------------------
	pNode	= m_Parameters.Add_Node(NULL, "NODE_THUMBNAILS", _TL("Thumbnails"), _TL(""));

	m_Parameters.Add_Value(
		pNode	, "THUMBNAIL_SIZE"		, _TL("Thumbnail Size"),
		_TL(""),
		PARAMETER_TYPE_Int, 75, 10, true
	);

	m_Parameters.Add_Value(
		pNode	, "THUMBNAIL_SELCOLOR"	, _TL("Selection Color"),
		_TL(""),
		PARAMETER_TYPE_Color, Get_Color_asInt(SYS_Get_Color(wxSYS_COLOUR_BTNSHADOW))
	);

	//-----------------------------------------------------
	CONFIG_Read("/MAPS", &m_Parameters);
}
Ejemplo n.º 15
0
//---------------------------------------------------------
CSAGA_Frame::CSAGA_Frame(void)
	: wxMDIParentFrame(NULL, ID_WND_MAIN, SAGA_CAPTION, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxHSCROLL|wxVSCROLL|wxFRAME_NO_WINDOW_MENU)
{
	//-----------------------------------------------------
	g_pSAGA_Frame		= this;

	m_nTopWindows		= 0;
	m_pTopWindows		= NULL;

	m_pINFO				= NULL;
	m_pData_Source		= NULL;
	m_pActive			= NULL;
	m_pWKSP				= NULL;

	SG_Set_UI_Callback	(Get_Callback());

	SetIcon				(IMG_Get_Icon(ID_IMG_SAGA_ICON_32));

	SetDropTarget		(new CSAGA_Frame_DropTarget);

	//-----------------------------------------------------
	int		STATUSBAR_Sizes[STATUSBAR_COUNT]	= {	-1, -1, 90, 90, 90, -1	};

	CreateStatusBar		(STATUSBAR_COUNT);
	SetStatusWidths		(STATUSBAR_COUNT, STATUSBAR_Sizes);
	SetStatusBarPane	(STATUSBAR_DEFAULT);
	StatusBar_Set_Text	(_TL("ready"));

	m_pProgressBar		= ((CSAGA_Frame_StatusBar *)GetStatusBar())->m_pProgressBar;

	//-----------------------------------------------------
	m_pLayout			= new wxAuiManager(this);

	m_pLayout->GetArtProvider()->SetColor	(wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR,
		wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)
	);

	m_pLayout->GetArtProvider()->SetColor	(wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR,
		wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
	);

	m_pLayout->GetArtProvider()->SetMetric	(wxAUI_DOCKART_GRADIENT_TYPE	, wxAUI_GRADIENT_NONE);
	m_pLayout->GetArtProvider()->SetMetric	(wxAUI_DOCKART_CAPTION_SIZE		, 14);

	m_pLayout->SetFlags(m_pLayout->GetFlags() ^ wxAUI_MGR_TRANSPARENT_DRAG);
//	m_pLayout->SetFlags(m_pLayout->GetFlags() ^ wxAUI_MGR_ALLOW_ACTIVE_PANE);

	//-----------------------------------------------------
	_Bar_Add(m_pINFO		= new CINFO       (this), 0, 0);	m_pINFO			->Add_Pages();
	_Bar_Add(m_pWKSP		= new CWKSP       (this), 2, 1);	m_pWKSP			->Add_Pages();
	_Bar_Add(m_pData_Source	= new CData_Source(this), 2, 1);	m_pData_Source	->Add_Pages();
	_Bar_Add(m_pActive		= new CACTIVE     (this), 2, 0);	m_pActive		->Add_Pages();

	//-----------------------------------------------------
	_Create_MenuBar();

	//-----------------------------------------------------
	m_pTB_Main			= 						  _Create_ToolBar();
	m_pTB_Map			= CVIEW_Map				::_Create_ToolBar();
	m_pTB_Map_3D		= CVIEW_Map_3D			::_Create_ToolBar();
	m_pTB_Layout		= CVIEW_Layout			::_Create_ToolBar();
	m_pTB_Table			= CVIEW_Table			::_Create_ToolBar();
	m_pTB_Diagram		= CVIEW_Table_Diagram	::_Create_ToolBar();
	m_pTB_Histogram		= CVIEW_Histogram		::_Create_ToolBar();
	m_pTB_ScatterPlot	= CVIEW_ScatterPlot		::_Create_ToolBar();

	//-----------------------------------------------------
	m_pLayout->GetPane(GetClientWindow()).Show().Center();

	wxString	s;

	if( CONFIG_Read(wxT("/FL"), wxT("MANAGER"), s) )
	{
		m_pLayout->LoadPerspective(s);
	}

	_Bar_Show(m_pTB_Main, true);

	//-----------------------------------------------------
	m_pLayout->Update();

#if !defined(_SAGA_LINUX)
	Show(true);
#endif

	int		x, y, dx, dy;
	long	l;

	x	= CONFIG_Read(wxT("/FL"), wxT("X" ), l) ? l : -1;
	y	= CONFIG_Read(wxT("/FL"), wxT("Y" ), l) ? l : -1;
	dx	= CONFIG_Read(wxT("/FL"), wxT("DX"), l) ? l : 800;
	dy	= CONFIG_Read(wxT("/FL"), wxT("DY"), l) ? l : 600;

	SetSize(x, y, dx, dy);

	if( !(CONFIG_Read(wxT("/FL"), wxT("STATE"), l) && l == 0) )
	{
		Maximize();
	}

#if defined(_SAGA_LINUX)
	Show(true);
#endif

	Update();

	//-----------------------------------------------------
	if( g_pSAGA->argc <= 1 && g_pData->Initialise() )
	{
		Refresh(false);
	}

	ProgressBar_Set_Position(0);
}