示例#1
0
void CAclApp::Cancel()
{
	if((m_bButtonFlags & ACL_BUTTON_CANCEL_MASK) != ACL_BUTTON_CANCEL_MASK) return;

	m_History.Cancel();
	InitView();
}
示例#2
0
void ModelCanvas::RenderADT()
{
	if (!init)
		InitGL();

	InitView();

	// From what I can tell, WoW OpenGL only uses 4 g_modelViewer->lightControl->lights
	for (int i=0; i<4; i++) {
		GLuint light = GL_LIGHT0 + i;
		glLightf(light, GL_CONSTANT_ATTENUATION, 0.0f);
		glLightf(light, GL_LINEAR_ATTENUATION, 0.7f);
		glLightf(light, GL_QUADRATIC_ATTENUATION, 0.03f);
		glDisable(light);
	}

	glLightModelfv(GL_LIGHT_MODEL_AMBIENT, Vec4D(0.35f, 0.35f, 0.35f, 1.0f));
	glColor3f(1.0f, 1.0f, 1.0f);

	glEnable(GL_TEXTURE_2D);
	glEnable(GL_DEPTH_TEST);
	glDisable(GL_CULL_FACE);

	root->draw(this);
	//root->drawParticles(true);
}
示例#3
0
BOOL CAclApp::OnInitDialog() 
{
	CDialog::OnInitDialog();

	m_pParent = GetParent()->GetParent();

	m_History.InitHistory(ACL_TYPE_APP, &theApp.m_AclFile);
	
	m_QueryCombo.SubclassDlgItem(IDC_COMBO_SET, this);
	AddComboStrings(&m_QueryCombo, ACL_QUERY_TEXT, ACL_QUERY_TEXT_COUNT);

	m_Label[0].SubclassDlgItem(IDC_LABEL_PASSALL, this);
	m_Label[1].SubclassDlgItem(IDC_LABEL_DENYIN, this);
	m_Label[2].SubclassDlgItem(IDC_LABEL_DENYOUT, this);
	m_Label[3].SubclassDlgItem(IDC_LABEL_DENYALL, this);
	m_Label[4].SubclassDlgItem(IDC_LABEL_QUERY, this);

	m_Button[RADIO_APP_PASS].SetRadioButton(IDC_ACL_RADIO_PASS, IDB_RADIO_NORMAL, IDB_RADIO_SELECT, this);
	m_Button[RADIO_APP_DENYIN].SetRadioButton(IDC_ACL_RADIO_DENYIN, IDB_RADIO_NORMAL, IDB_RADIO_SELECT, this);
	m_Button[RADIO_APP_DENYOUT].SetRadioButton(IDC_ACL_RADIO_DENYOUT, IDB_RADIO_NORMAL, IDB_RADIO_SELECT, this);
	m_Button[RADIO_APP_DENY].SetRadioButton(IDC_ACL_RADIO_DENY, IDB_RADIO_NORMAL, IDB_RADIO_SELECT, this);
	m_Button[RADIO_APP_QUERY].SetRadioButton(IDC_ACL_RADIO_QUERY, IDB_RADIO_NORMAL, IDB_RADIO_SELECT, this);

	m_List.SubclassDlgItem(IDC_ACL_LIST, this);
	AddListHead(&m_List, ACL_APP_LIST_HEADER, sizeof(ACL_APP_LIST_HEADER)/sizeof(TCHAR*), ACL_APP_LIST_LENTH);

	m_ImageList.Create(16, 16, ILC_COLORDDB, 0, 50);

	InitView();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
示例#4
0
Window*
pnlTaskProperties::Load(SingleWindow &parent, TabBarControl* wTabBar,
                        WndForm* _wf, OrderedTask** task, bool* _task_modified)
{
  ordered_task_pointer = task;
  ordered_task = *ordered_task_pointer;;

  assert(_task_modified);
  task_changed = _task_modified;

  assert(_wf);
  wf = _wf;

  Window *wProp =
      LoadWindow(dlgTaskManager::CallBackTable, wf, *wTabBar,
                 Layout::landscape ?
                 _T("IDR_XML_TASKPROPERTIES_L") : _T("IDR_XML_TASKPROPERTIES"));

  wTaskView = (WndOwnerDrawFrame*)wf->FindByName(_T("frmTaskViewProperties"));
  assert(wTaskView != NULL);
  wTaskView->SetOnMouseDownNotify(dlgTaskManager::OnTaskViewClick);

  assert(wProp);

  InitView();

  return wProp;
}
示例#5
0
BOOL CAclWeb::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_pParent = GetParent()->GetParent();
	
	m_List.SubclassDlgItem(IDC_ACL_LIST, this);
	AddListHead(&m_List, ACL_WEB_LIST_HEADER, sizeof(ACL_WEB_LIST_HEADER)/sizeof(TCHAR*), ACL_WEB_LIST_LENTH);

	m_QueryCombo.SubclassDlgItem(IDC_COMBO_SET, this);
	AddComboStrings(&m_QueryCombo, ACL_QUERY_TEXT, ACL_QUERY_TEXT_COUNT);
	m_QueryCombo.SetCurSel(theApp.m_AclFile.GetHeader()->bWebQueryEx);

	m_Label[0].SubclassDlgItem(IDC_LABEL_PASSALL, this);
	m_Label[1].SubclassDlgItem(IDC_LABEL_QUERY, this);

	m_Button[RADIO_WEB_PASS].SetRadioButton(IDC_ACL_RADIO_PASS, IDB_RADIO_NORMAL, IDB_RADIO_SELECT, this);
	m_Button[RADIO_WEB_QUERY].SetRadioButton(IDC_ACL_RADIO_QUERY, IDB_RADIO_NORMAL, IDB_RADIO_SELECT, this);

	m_History.InitHistory(ACL_TYPE_WEB, &theApp.m_AclFile);
	InitView();
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
示例#6
0
BOOL CPanelDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	InitView();
	InitData();
	return TRUE;
}
示例#7
0
CMixereView::CMixereView() :
#pragma warning(disable : 4355)	// 'this' used in base member initializer list
	// these ctors don't access 'this', they only copy it to a member var
	m_VolumeBar(this),
	m_TempoBar(this),
	m_MSFadeBar(this),
	m_SnapshotBar(this)
#pragma warning(default : 4355)
{
	//{{AFX_DATA_INIT(CMixereView)
	//}}AFX_DATA_INIT
	CString	ClipboardID;
	ClipboardID.Format("Mixere%d\n", CMixerInfo::FILE_VERSION);
	InitView(m_ColumnInfo, COLUMNS, sizeof(CChanInfo), ClipboardID);
	m_DlgBar[DLGBAR_VOLUME] = &m_VolumeBar;
	m_DlgBar[DLGBAR_SNAPSHOT] = &m_SnapshotBar;
	m_DlgBar[DLGBAR_MS_FADE] = &m_MSFadeBar;
	m_DlgBar[DLGBAR_TEMPO] = &m_TempoBar;
	m_ChildFrm = NULL;
	m_MultiMix = ((CMainFrame *)AfxGetMainWnd())->GetMultiMix();
	m_MultiAutoDlg = NULL;
	m_Snapshot = NULL;
	m_HasToolTips = FALSE;
	m_MuteCount = 0;
	m_SoloCount = 0;
	m_Tempo = 1;
	m_ChanIDs = 0;
	m_UndoIdx = 0;
	m_PrevPos = 0;
	m_FindDlg = NULL;
	m_NewFind = FALSE;
	m_FindMatchCase = FALSE;
	m_FindSearchDown = FALSE;
}
DecPackSetting::DecPackSetting(QWidget *parent) :
QDialog(parent),
ui(new Ui::DecPackSetting)
{
	ui->setupUi(this);
	InitView();
	InitSlot();
}
示例#9
0
void CAclWeb::Cancel()
{
	if((m_bButtonFlags & ACL_BUTTON_CANCEL_MASK) != ACL_BUTTON_CANCEL_MASK) return;

	m_History.Cancel();
	InitView();
	SendMessageEx(m_bButtonFlags & ~ACL_BUTTON_SHOW_APPLY_GROUP);
}
SetJdkPath::SetJdkPath(QWidget *parent) :
QDialog(parent),
ui(new Ui::SetJdkPath)
{
	ui->setupUi(this);
	InitSlot();
	InitView();
}
BjTableView::BjTableView(QWidget *parent):
QTableView(parent),
mmenu(parent),
mpinterface(NULL)
{
	InitView();
	InitSlot();	
}
示例#12
0
BOOL CTransferDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	InitView();
	InitData();

	return TRUE;
}
示例#13
0
NewBuildTab::NewBuildTab(wxWindow* parent)
    : wxPanel(parent)
    , m_warnCount(0)
    , m_errorCount(0)
    , m_buildInterrupted(false)
    , m_autoHide(false)
    , m_showMe(BuildTabSettingsData::ShowOnStart)
    , m_skipWarnings(false)
    , m_buildpaneScrollTo(ScrollToFirstError)
    , m_buildInProgress(false)
    , m_maxlineWidth(wxNOT_FOUND)
    , m_lastLineColoured(wxNOT_FOUND)
{
    SetSize(wxNOT_FOUND, 400);
    m_curError = m_errorsAndWarningsList.end();
    wxBoxSizer* bs = new wxBoxSizer(wxVERTICAL);
    SetSizer(bs);

    m_view = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);
    // We dont really want to collect undo in the output tabs...
    InitView();
    Bind(wxEVT_IDLE, &NewBuildTab::OnIdle, this);

    m_view->Bind(wxEVT_STC_HOTSPOT_CLICK, &NewBuildTab::OnHotspotClicked, this);
    EventNotifier::Get()->Bind(wxEVT_CL_THEME_CHANGED, &NewBuildTab::OnThemeChanged, this);

    bs->Add(m_view, 1, wxEXPAND | wxALL);

    BuildTabTopPanel* toolbox = new BuildTabTopPanel(this);
    bs->Insert(0, toolbox, 0, wxEXPAND);

    EventNotifier::Get()->Connect(wxEVT_SHELL_COMMAND_STARTED, clCommandEventHandler(NewBuildTab::OnBuildStarted), NULL,
                                  this);
    EventNotifier::Get()->Connect(wxEVT_SHELL_COMMAND_STARTED_NOCLEAN,
                                  clCommandEventHandler(NewBuildTab::OnBuildStarted), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_SHELL_COMMAND_ADDLINE, clCommandEventHandler(NewBuildTab::OnBuildAddLine), NULL,
                                  this);
    EventNotifier::Get()->Connect(wxEVT_SHELL_COMMAND_PROCESS_ENDED, clCommandEventHandler(NewBuildTab::OnBuildEnded),
                                  NULL, this);

    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(NewBuildTab::OnWorkspaceLoaded), NULL,
                                  this);
    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(NewBuildTab::OnWorkspaceClosed), NULL,
                                  this);

    wxTheApp->Connect(XRCID("next_build_error"), wxEVT_COMMAND_MENU_SELECTED,
                      wxCommandEventHandler(NewBuildTab::OnNextBuildError), NULL, this);
    wxTheApp->Connect(XRCID("next_build_error"), wxEVT_UPDATE_UI,
                      wxUpdateUIEventHandler(NewBuildTab::OnNextBuildErrorUI), NULL, this);
}
示例#14
0
//!***************************************************************
//! @details:
//! initializes the game and subsystems
//!
//! @return: 
//! void
//! 
//!***************************************************************
void Game::Init()
{
	// load the game map
	CreateMap();

	// initialize the cameras and view
	InitView();

	// initialize the user input
	CreateInput();

	// prep the engine for running
	m_engine->initializePumping();
}
示例#15
0
void ModelCanvas::InitGL()
{
	video.InitGL();

	GLenum err = 0;

	init = true;

	// load up our shaders
	InitShaders();

	// init the default view
	InitView();
}
示例#16
0
static void InitializeGlut(int *argc, char *argv[])
{
  glutInit(argc, argv);
  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL);
  glutInitWindowSize(WINSIZE,WINSIZE*0.8);
  glutCreateWindow("Motion Player Demonstration");
  glutDisplayFunc(DisplayScene);
  glutIdleFunc(Idle);
  glutKeyboardFunc( keyboard );
  glutMouseFunc(mouse);
  glutMotionFunc(motion); 
  glutPassiveMotionFunc(motion);
  glutReshapeFunc(reshape);
  InitView();
}
示例#17
0
void
AppView::AttachedToWindow()
{
	PRINT(("AppView::AttachedToWindow()\n"));

	BView::AttachedToWindow();

	InitView();

	m_list_view->SetTarget(this);
	m_apply_button->SetTarget(this);
	m_reset_button->SetTarget(this);

	m_apply_button->MakeDefault(true);
}
示例#18
0
void
TaskPropertiesPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  instance = this;

  LoadWindow(task_properties_callbacks, parent,
             Layout::landscape
             ? _T("IDR_XML_TASKPROPERTIES_L") : _T("IDR_XML_TASKPROPERTIES"));

  wTaskView = (WndOwnerDrawFrame*)form.FindByName(_T("frmTaskViewProperties"));
  assert(wTaskView != NULL);
  wTaskView->SetOnMouseDownNotify(dlgTaskManager::OnTaskViewClick);

  InitView();
}
int SECEditCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (SECEditCore<CWnd>::OnCreate(lpCreateStruct) == -1)
		return -1;

	RegisterDropTarget();

	InitView();

	// These lines tweak the Vertical Scroll Bar 
	// and makes it appear properly
	MySetScrollRange(SB_VERT, 0, 32000, TRUE); 
	MySetScrollRange(SB_VERT, 0, 0,TRUE); 

	return 0;
}
示例#20
0
BOOL CHostDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	InitView();
	InitResize();
	if (!StartMasterWorking())
	{
		::MessageBox(NULL, _T("初始化工作线程失败!"), _T("Error"), MB_OK | MB_ICONERROR);
		ExitProcess(0);
	}
	SetClientInfoNotifies(ClientInfoNotify,this);

	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
示例#21
0
void EffectDock::SetPath(const QString& path){
    mPath = path;
    if(mPath.isEmpty()){
        ui.tree->setModel(NULL);
        ui.tree->setContextMenuPolicy(Qt::NoContextMenu);
    }else if(ui.tree->model()==NULL){
        ui.tree->setModel(mpModel);
        ui.tree->setRootIndex(mpModel->setRootPath(mPath));
        ui.tree->setContextMenuPolicy(Qt::ActionsContextMenu);
        InitView();
    }else{
        ui.tree->setRootIndex(mpModel->setRootPath(mPath));
        //hack: setRootIndex时,并不会改变CurrentIndex,需要自己设置一个无效的CurrentIndex,
        //这应该是Qt的bug。
        ui.tree->setCurrentIndex(QModelIndex());
    }
    UpdateAction();
}
示例#22
0
void CRegister::InitDlgResource()
{
	ModifyStyleEx(WS_EX_TOOLWINDOW, WS_EX_APPWINDOW); 

	int i = 0;
	for(i; i < REGISTER_COMBO_ARRAY_COUNT; i++)
	{
		m_Combo[i].SubclassDlgItem(REGISTER_COMBO_ARRAY[i], this);
		InitCombo(&m_Combo[i], (char**)REGISTER_STRING_ARRAY[i], REGISTER_STRING_COUNT_ARRAY[i], 0);
	}
	for(i = 0; i < REGISTER_CHECK_ARRAY_COUNT; i++)
		m_Check[i].SubclassDlgItem(REGISTER_CHECK_ARRAY[i], this);
	m_EditOffenToWeb.SubclassDlgItem(IDC_EDIT_OFFEN_TO_WEB, this);
	m_EditOffenToWeb.SetLimitText(50);

	m_EditCity.SubclassDlgItem(IDC_REG_EDIT_CITY, this);
	m_EditCity.SetLimitText(20);

	m_EditRecommender.SubclassDlgItem(IDC_REG_EDIT_EMAIL2, this);
	m_EditRecommender.SetLimitText(50);

	m_StaticAd.SubclassDlgItem(IDC_AD, this);
	m_StaticAd.SetColor(COLOR_BLUE);

	m_HyperLink.SubclassDlgItem(IDC_WEB, this);

	InitCombo(&m_ComboGender, GUI_GENDER,  (sizeof(GUI_GENDER)  / sizeof(TCHAR*)), 0);
	InitCombo(&m_ComboDegree, GUI_DEGREE,  (sizeof(GUI_DEGREE)  / sizeof(TCHAR*)), 0);
	InitCombo(&m_ComboMetier, GUI_METIER,  (sizeof(GUI_METIER)  / sizeof(TCHAR*)), 0);
	InitCombo(&m_ComboSalary, GUI_SALARY,  (sizeof(GUI_SALARY)  / sizeof(TCHAR*)), 0);

	m_EditEmail.SetLimitText(50);
	m_EditName.SetLimitText(20);
	m_EditDuty.SetLimitText(20);
	m_EditZip.SetLimitText(6);
	m_EditAddress.SetLimitText(50);
	m_EditQq.SetLimitText(12);
	m_EditInc.SetLimitText(50);

	if(m_pInternet != NULL)
		m_UserInfo = m_pInternet->m_UserInfo;
	InitView(&m_UserInfo);
}
示例#23
0
bool CIwGameUITextView::LoadFromXoml(IIwGameXomlResource* parent, bool load_children, CIwGameXmlNode* node)
{
	if (parent->getClassTypeHash() != CIwGameXomlNames::Scene_Hash && parent->getClassTypeHash() != CIwGameXomlNames::Actor_Hash)
	{
		CIwGameError::LogError("Error: XOML - TextView needs to be declared inside a scene or an actor");
		return false;
	}

	// Load main actor attributes
	if (!CIwGameUILabel::LoadFromXoml(parent, false, node))
		return false;

	// Process Imageview specific attributes
	CIwGameString	brush_name;
	CIwFVec2		area = CIwFVec2(-100, -100);
	float			scale = 1.0f;

	for (CIwGameXmlNode::_AttribIterator it = node->attribs_begin(); it != node->attribs_end(); it++)
	{
		unsigned int name_hash = (*it)->getName().getHash();

		if (name_hash == CIwGameXomlNames::Zoom_Hash)
			scale = (*it)->GetValueAsFloat();
		else
		if (name_hash == CIwGameXomlNames::MinZoom_Hash)
			MinZoom = (*it)->GetValueAsFloat();
		else
		if (name_hash == CIwGameXomlNames::MaxZoom_Hash)
			MaxZoom = (*it)->GetValueAsFloat();
	}

	InitView(true, MinZoom, MaxZoom);
	setZoom(scale);

	if (load_children)
	{
		// Process inner tags
		if (!IW_GAME_XOML->Process(TextActor, node))
			return false;
	}
	return true;
}
示例#24
0
void ObjectDock::SetPath(const QString &path)
{
     mPath = path;
    if(mPath.isEmpty())
    {
        ui->tree->setModel(NULL);
        ui->tree->setContextMenuPolicy(Qt::NoContextMenu);
    }
    else if(ui->tree->model() == NULL)
    {
        ui->tree->setModel(mpModel);
        ui->tree->setRootIndex(mpModel->setRootPath(mPath));
        ui->tree->setContextMenuPolicy(Qt::ActionsContextMenu);
        InitView();
    }
    else
    {
        ui->tree->setRootIndex(mpModel->setRootPath(mPath));
        ui->tree->setCurrentIndex(QModelIndex());
    }
    UpdateAction();
}
示例#25
0
void NewBuildTab::OnWorkspaceLoaded(wxCommandEvent& e)
{
    e.Skip();
    DoClear();
    InitView();
}
示例#26
0
void  PD_2DXYPS::SetupDataView()
{
    SetClearColor(defaultPenSet->GetColor(plotBackgroundPen));
    InitView();
}
示例#27
0
void NewBuildTab::OnBuildStarted(clCommandEvent& e)
{
    e.Skip();

    if(IS_WINDOWS) {
        m_cygwinRoot.Clear();
        EnvSetter es;
        wxString cmd;
        cmd << "cygpath -w /";
        wxArrayString arrOut;
        ProcUtils::SafeExecuteCommand(cmd, arrOut);

        if(arrOut.IsEmpty() == false) { m_cygwinRoot = arrOut.Item(0); }
    }

    m_buildInProgress = true;

    // Reload the build settings data
    EditorConfigST::Get()->ReadObject(wxT("build_tab_settings"), &m_buildTabSettings);
    InitView();

    m_autoHide = m_buildTabSettings.GetAutoHide();
    m_showMe = (BuildTabSettingsData::ShowBuildPane)m_buildTabSettings.GetShowBuildPane();
    m_skipWarnings = m_buildTabSettings.GetSkipWarnings();

    if(e.GetEventType() != wxEVT_SHELL_COMMAND_STARTED_NOCLEAN) {
        DoClear();
        DoCacheRegexes();
    }

    // Show the tab if needed
    OutputPane* opane = clMainFrame::Get()->GetOutputPane();

    wxWindow* win(NULL);
    int sel = opane->GetNotebook()->GetSelection();
    if(sel != wxNOT_FOUND) { win = opane->GetNotebook()->GetPage(sel); }

    if(m_showMe == BuildTabSettingsData::ShowOnStart) {
        ManagerST::Get()->ShowOutputPane(BUILD_WIN, true);

    } else if(m_showMe == BuildTabSettingsData::ShowOnEnd && m_autoHide &&
              ManagerST::Get()->IsPaneVisible(opane->GetCaption()) && win == this) {
        // user prefers to see build/errors tabs only at end of unsuccessful build
        ManagerST::Get()->HidePane(opane->GetName());
    }
    m_sw.Start();

    m_cmp.Reset(NULL);
    BuildEventDetails* bed = dynamic_cast<BuildEventDetails*>(e.GetClientObject());
    if(bed) {
        BuildConfigPtr buildConfig =
            clCxxWorkspaceST::Get()->GetProjBuildConf(bed->GetProjectName(), bed->GetConfiguration());
        if(buildConfig) { m_cmp = buildConfig->GetCompiler(); }

        // notify the plugins that the build had started
        clBuildEvent buildEvent(wxEVT_BUILD_STARTED);
        buildEvent.SetProjectName(bed->GetProjectName());
        buildEvent.SetConfigurationName(bed->GetConfiguration());
        EventNotifier::Get()->AddPendingEvent(buildEvent);
    }
}
示例#28
0
void NewBuildTab::OnThemeChanged(wxCommandEvent& event)
{
    event.Skip();
    InitView();
}
示例#29
0
int CzUIWebView::LoadFromXoml(IzXomlResource* parent, bool load_children, CzXmlNode* node)
{
	if (parent->getClassTypeHash() != CzHashes::Scene_Hash && parent->getClassTypeHash() != CzHashes::Actor_Hash)
	{
		CzDebug::Log(CZ_DEBUG_CHANNEL_ERROR, "WebView - Needs to be declared inside a scene or an actor - ", DebugInfo.c_str());
		return 0;
	}

	// Load main actor attributes
	int ret = CzUIBase::LoadFromXoml(parent, false, node);
	if (ret <= 0)
		return ret;

	// Process WebView specific attributes
	bool modal = false;
	bool transparent = false;
	const char* java_script = NULL;

	for (CzXmlNode::_AttribIterator it = node->attribs_begin(); it != node->attribs_end(); it++)
	{
		unsigned int name_hash = (*it)->getName().getHash();
		if (name_hash == CzHashes::URI_Hash)
			URI = (*it)->getValue();
		else
		if (name_hash == CzHashes::Modal_Hash)
			modal = (*it)->getValueAsBool();
		else
		if (name_hash == CzHashes::JavaScript_Hash)
			java_script = (*it)->getValue().c_str();
		else
		if (name_hash == CzHashes::Transparent_Hash)
			transparent = (*it)->getValueAsBool();
		else
		if (name_hash == CzHashes::Html_Hash)
			setHtml((*it)->getValue().c_str());
		else
		if (name_hash == CzHashes::OnError_Hash)
			EventsManager->addEvent("OnError", (*it)->getValue().c_str(), true);
		else
		if (name_hash == CzHashes::OnPageLoaded_Hash)
			EventsManager->addEvent("OnPageLoaded", (*it)->getValue().c_str(), true);
		else
		if (name_hash == CzHashes::OnPageLoading_Hash)
			EventsManager->addEvent("OnPageLoading", (*it)->getValue().c_str(), true);
		else
		if (name_hash == CzHashes::OnPageError_Hash)
			EventsManager->addEvent("OnPageError", (*it)->getValue().c_str(), true);
		else
		if (name_hash == CzHashes::OnJavascript_Hash)
			EventsManager->addEvent("OnJavascript", (*it)->getValue().c_str(), true);
	}

	if (!PLATFORM_UI->isWebViewAvailable())
	{
		ProcessEventActions(CZ_HASH("OnError"));
		CzDebug::Log(CZ_DEBUG_CHANNEL_ERROR, "WebView - Not supported on this platform - ", DebugInfo.c_str());
		return -1;
	}

	InitView(modal, transparent, java_script);

	// Process inner tags
	if (load_children)
	{
		if (!CZ_XOML->Process(this, node))
			return 0;
	}

	return 1;
}
示例#30
0
int CzUIImageView::LoadFromXoml(IzXomlResource* parent, bool load_children, CzXmlNode* node)
{
	if (parent->getClassTypeHash() != CzHashes::Scene_Hash && parent->getClassTypeHash() != CzHashes::Actor_Hash)
	{
		CzDebug::Log(CZ_DEBUG_CHANNEL_ERROR, "ImageView - ImageView needs to be declared inside a scene or an actor - ", DebugInfo.c_str());
		return 0;
	}

	// Load main actor attributes
	int ret = CzUIBase::LoadFromXoml(parent, false, node);
	if (ret <= 0)
		return ret;

	// Process Imageview specific attributes
	CzString	brush_name;
	CzVec2		brush_size = CzVec2(-100, -100);
	float		scale = 1.0f;

	for (CzXmlNode::_AttribIterator it = node->attribs_begin(); it != node->attribs_end(); it++)
	{
		unsigned int name_hash = (*it)->getName().getHash();

		if (name_hash == CzHashes::ImageBrush_Hash)
		{
			brush_name = (*it)->getValue();
		}
		else
		if (name_hash == CzHashes::Area_Hash)
		{
			if (!(*it)->getValueAsPoint(brush_size))
				CzDebug::Log(CZ_DEBUG_CHANNEL_WARNING, "ImageView - Invalid value for ImageView::Area expected vec2 - ", DebugInfo.c_str());
		}
		else
		if (name_hash == CzHashes::Zoom_Hash)
			scale = (*it)->getValueAsFloat();
		else
		if (name_hash == CzHashes::MinZoom_Hash)
			MinZoom = (*it)->getValueAsFloat();
		else
		if (name_hash == CzHashes::MaxZoom_Hash)
			MaxZoom = (*it)->getValueAsFloat();
	}

	CzBrushImage* brush = NULL;
	if (!brush_name.isEmpty())
	{
		brush = (CzBrushImage*)Scene->getResourceManager()->findResource(brush_name.getHash(), CzHashes::Brush_Hash);
		if (brush != NULL)
		{
			InitView(brush, (int)brush_size.x, (int)brush_size.y, true, MinZoom, MaxZoom);
			setZoom(scale);
		}
		else
			CzDebug::Log(CZ_DEBUG_CHANNEL_WARNING, "ImageView - Could not find named brush in the scene or in the global resources - ", brush_name.c_str(), DebugInfo.c_str());
	}

	if (load_children)
	{
		// Process inner tags
//		if (!CZ_XOML->Process(this, node))
		if (!CZ_XOML->Process(Icon, node))
			return 0;
	}

	return 1;
}