Ejemplo n.º 1
0
void COXCustomizeCaptionPage::OnCheckGradient() 
{
	// TODO: Add your control notification handler code here

	ShowControls();
	SetVars();
}
Ejemplo n.º 2
0
static void MenuDraw(void *data)
{
	const MenuSystem *ms = data;
	GraphicsBlitBkg(ms->graphics);
	ShowControls();
	MenuDisplay(ms);
}
Ejemplo n.º 3
0
void MenuLoop(MenuSystem *menu)
{
	assert(menu->numExitTypes > 0);
	for (;; SDL_Delay(10))
	{
		// Input
		InputPoll(menu->joysticks, menu->keyboard);
		// Update
		if (menu->current->type == MENU_TYPE_KEYS &&
			menu->current->u.normal.changeKeyMenu != NULL)
		{
			MenuProcessChangeKey(menu->current);
		}
		else
		{
			int cmd = GetMenuCmd();
			menu->current = MenuProcessCmd(menu->current, cmd);
		}
		if (MenuHasExitType(menu, menu->current->type))
		{
			break;
		}
		// Draw
		if (menu->bkg != NULL)
		{
			memcpy(
				GetDstScreen(),
				menu->bkg,
				GraphicsGetMemSize(&gGraphicsDevice.cachedConfig));
		}
		ShowControls();
		MenuDisplay(menu);
		CopyToScreen();
	}
}
Ejemplo n.º 4
0
int MainMenu(void *bkg)
{
	int cmd, prev = 0;
	int mode;

	PaletteAdjust();

	mode = MODE_MAIN;

	while (mode != MODE_QUIT && mode != MODE_PLAY) {
		memcpy(GetDstScreen(), bkg, SCREEN_MEMSIZE);
		ShowControls();

		if (mode == MODE_MAIN)
			ShowCredits();

		GetMenuCmd(&cmd);

		if (cmd == prev)
			cmd = 0;
		else
			prev = cmd;

		mode = MakeSelection(mode, cmd);
		
		CopyToScreen();

		SDL_Delay(10);
	}

	WaitForRelease();

	return mode == MODE_PLAY;
}
Ejemplo n.º 5
0
void MenuLoop(MenuSystem *menu)
{
	assert(menu->numExitTypes > 0);
	for (;; SDL_Delay(10))
	{
		MusicSetPlaying(&gSoundDevice, SDL_GetAppState() & SDL_APPINPUTFOCUS);
		// Input
		InputPoll(menu->inputDevices, SDL_GetTicks());
		// Update
		if (menu->current->type == MENU_TYPE_KEYS &&
			menu->current->u.normal.changeKeyMenu != NULL)
		{
			MenuProcessChangeKey(menu->current);
		}
		else
		{
			int cmd = GetMenuCmd(gPlayerDatas);
			MenuProcessCmd(menu, cmd);
		}
		if (MenuIsExit(menu))
		{
			break;
		}
		// Draw
		GraphicsBlitBkg(menu->graphics);
		ShowControls();
		MenuDisplay(menu);
		BlitFlip(menu->graphics, &gConfig.Graphics);
	}
}
Ejemplo n.º 6
0
/**
 * 
 * @return false to exit or change level, true otherwise.
 */
bool PlayerUI::Input(bool* levelEnded, bool* downLevel)
{
    int x;
    int y;
    player->GetPos(&x, &y); /*Get current position for movement*/

    int thisX = x; //set movement positions to default
    int thisY = y;

    ShowControls();
    int choice = mainUI->ConsoleGetInput();

    if (choice == KEY_UP || choice == 'w') thisY--;
    else if (choice == KEY_RIGHT || choice == 'd') thisX++;
    else if (choice == KEY_DOWN || choice == 's') thisY++;
    else if (choice == KEY_LEFT || choice == 'a') thisX--;
    else if (choice == 'q' || choice == KEY_EXIT ) return false;
    else if (choice == 'c') return TextInput();
    else if (choice == 'i') AccessPlayerInv();

        //handle any movement input
    if ((x != thisX) || (y != thisY)) {
        PlayerMoveTurn(thisX, thisY,levelEnded,downLevel);
        
        if (*levelEnded) return false;
    }
    
    return true;
}
Ejemplo n.º 7
0
//////////////////////////////////////////////////////////////////////////
// NAME : OnBtnNetwork
// PARM : void
// RETN : void
// DESC : 전파버튼(|||) 클릭 => 로드수 나타내기 
// DATE : 2005-12-29 coded by lizzy, origin
//////////////////////////////////////////////////////////////////////////
void CDlg_Search::OnBtnNetwork() 
{
	//로드 수 가져오기..
	MakeLoadNumData();
	SetCurrType(TYPE_SRCH_LOAD_DATA);	
	ShowControls(); 
}
Ejemplo n.º 8
0
void IControlGroup::ShowControlsWithSubgroups()
{
	ShowControls();

	for (int i = 0; i < controlSubgroups.size(); i++)
	{
		controlSubgroups[i]->ShowControlsWithSubgroups();
	}
}
Ejemplo n.º 9
0
//////////////////////////////////////////////////////////////////////////
// NAME : OnBtnSearchRange
// PARM : void
// RETN : void
// DESC : 검색버튼(전체/로컬 상태)클릭 => 검색버튼(Normal)로 바꿔준다.즉 추천검색어 상태로  
// DATE : 2005-12-28 coded by lizzy, origin
//////////////////////////////////////////////////////////////////////////
void CDlg_Search::OnBtnSearchRange() 
{
	SetSrchRange(TYPE_SRCH_RANGE_ALL);
	LoadBmpSrchRangeBtn();

    SetCurrType(TYPE_SRCH_RCMMWORD);	
	ShowControls(); 

    Invalidate();
}
Ejemplo n.º 10
0
void IControlGroup::UpdateVisibilityStatusOfAttachedControls()
{
	if (IsGroupHidden() || IsGroupHiddenInSuperGroups())
	{
		HideControlsWithSubgroups();
	}
	else
	{
		ShowControls();

		for (int i = 0; i < controlSubgroups.size(); i++)
		{
			controlSubgroups[i]->UpdateVisibilityStatusOfAttachedControls();
		}
	}
}
Ejemplo n.º 11
0
//////////////////////////////////////////////////////////////////////////
// NAME : OnBtnSearchRangeNormal
// PARM : void
// RETN : void
// DESC : 검색버튼((Normal 상태)클릭 => 검색버튼(전체/로컬로 바꿔준다.)
// DATE : 2005-12-28 coded by lizzy, origin
//////////////////////////////////////////////////////////////////////////
void CDlg_Search::OnBtnSearchRangeNormal() 
{
	SetSrchRange(TYPE_SRCH_RANGE_LOCAL);
	LoadBmpSrchRangeBtn();	

//	SetCurrType(TYPE_SRCH_RANGE_BTN);	
    SetCurrType(TYPE_SRCH_RCMMWORD);
	ShowControls(); 
/*
    if( GetSrchRange() == TYPE_SRCH_RANGE_ALL )
		OnBtnSrchAll();
	else
		OnBtnSrchLocal();
*/
    Invalidate();
}
Ejemplo n.º 12
0
void CDlg_Search::EnableNetwork(BOOL bEnable)
{
	m_bNetEnable = bEnable;

	m_btnNetwork.EnableWindow(bEnable);
	m_btnNetworkLoad.EnableWindow(bEnable);

//	m_btnSrchRangeN.EnableWindow(bEnable);
//	m_btnSrchRangeAllLocal.EnableWindow(bEnable);

	if(!bEnable)
		SetSrchRange(TYPE_SRCH_RANGE_LOCAL);
	else
		SetSrchRange(TYPE_SRCH_RANGE_ALL);

	ShowControls();
}
Ejemplo n.º 13
0
BOOL WINPROC EXPORT DlgRoomDot2Dot (HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
{
    BOOL bHandled = TRUE;
    char szTemp[MAX_PATH];
    HWND hImageCtrl;

    switch (wMsg)
    {
        case WM_COMMAND:
            switch (wParam)
            {
            case HS_COVER:
				ShowControls(hWnd, TRUE);
				ShowCoverAnimatedButtons(hWnd, TRUE);
                break;
                
            case HS_SHOW_ME:
                iActiveDot = 0;
				bPlaying = FALSE;
				UpdateDot2DotImage(hWnd, NULL);
                break;
                
            case HS_COLORME_ME:
                RemoveCodedBackground();
                GoPaintApp (hWnd,szPreview);
                break;
                
            case HS_TAB1:
            case HS_TAB2:
            case HS_TAB3:
            case HS_TAB4:
            case HS_TAB5:
            case HS_TAB6:
            case HS_TAB7:
            case HS_TAB8:
                {
                    BOOL    bLoad;

					ShowCoverAnimatedButtons(hWnd, FALSE);
					ShowControls(hWnd, FALSE);
                    hImageCtrl = GetDlgItem(hWnd, IDC_HIDDEN_IMAGE);
                    
                    if (hImageCtrl)
                    {
                		wsprintf (szTemp,GetString (IDS_CIRCUS, NULL),wParam - HS_TAB1 + 1);
                        PathCat (szPreview,Control.PouchPath,szTemp);
                        bLoad = AstralImageLoad( 0, szPreview, TRUE, FALSE);
                        if (bLoad && lpImage)
                        {
							bPlaying = TRUE;
                            SetWindowLong(hImageCtrl, GWL_IMAGE,
                                (long) ImgGetBase (lpImage));
                            SetWindowLong(hImageCtrl, GWL_IMAGE_TOOLPROC,
                                (long) Dot2DotProc);
							InitPoints();
                            ImgSetPixelProc(Dot2DotPixelProc);
                            ShowWindow(hImageCtrl, SW_SHOW);
                            UpdateDot2DotImage(hWnd, NULL);
                        }
                    }
                        
                        
                } // HS_TABS
				SoundStartID(HS_XTRA_CIRCUS, FALSE, 0);
                break;
                
                default:
                    bHandled = FALSE;
            } // switch (wParam)
            break;
                          
        case WM_INITDIALOG:
            hDot2DotWnd = hWnd;
			ShowControls(hWnd, TRUE);
            bHandled = FALSE;           // allow DefRoomProc to be called.
            break;

        case WM_DESTROY:
            ImgSetPixelProc(NULL);      // make sure our proc is no longer used
            bHandled = FALSE;           // allow DefRoomProc to be called
            break;

        case WM_PAINT:
            hImageCtrl = GetDlgItem(hWnd, IDC_HIDDEN_IMAGE);
            DefRoomProc (hWnd,wMsg,wParam,lParam);
			UpdateWindow(hImageCtrl);
            PaintDot2Dots(hImageCtrl);
            break;
            
        default:
            bHandled = FALSE;    
    } // switch (wMsg)

    if (!bHandled)
        bHandled = DefRoomProc (hWnd,wMsg,wParam,lParam);
    return bHandled;
}
Ejemplo n.º 14
0
void COXCustomizeCaptionPage::SetVars()
{
	if(!UpdateData())
		return;

	CWnd* pWnd=AfxGetMainWnd();
	ASSERT(pWnd!=NULL && ::IsWindow(pWnd->GetSafeHwnd()));

	BOOL bActive=(m_ctlComboCaptionState.GetCurSel()==NULL)?TRUE:FALSE;
	COXCaptionInfo* pCI=NULL;
	
	pCI=bActive?&m_ActiveInfo:&m_PassiveInfo;

	pCI->SetGradient(m_bGradient);
	pCI->SetGradientAlgorithm(m_nGradientAlgorithm==0 ? ID_GRADIENT_LINEAR : 
		ID_GRADIENT_SQUARE);
	pCI->SetGradientAlignment(m_nGradientAlignment==0 ? ID_GRADIENT_LEFT :
		(m_nGradientAlignment==1 ? ID_GRADIENT_CENTER : ID_GRADIENT_RIGHT));

	UINT nTextFormat=DT_SINGLELINE;
	switch(m_nTextEllipsis)
	{
	case 0:
		break;
	case 1:
		nTextFormat|=DT_END_ELLIPSIS;
		break;
	case 2:
		nTextFormat|=DT_PATH_ELLIPSIS;
		break;
	default:
		ASSERT(FALSE);
	}

	switch(m_nTextAlignment)
	{
	case 0:
		nTextFormat|=DT_TOP|DT_LEFT;
		break;
	case 1:
		nTextFormat|=DT_TOP|DT_CENTER;
		break;
	case 2:
		nTextFormat|=DT_TOP|DT_RIGHT;
		break;
	case 3:
		nTextFormat|=DT_VCENTER|DT_LEFT;
		break;
	case 4:
		nTextFormat|=DT_VCENTER|DT_CENTER;
		break;
	case 5:
		nTextFormat|=DT_VCENTER|DT_RIGHT;
		break;
	case 6:
		nTextFormat|=DT_BOTTOM|DT_LEFT;
		break;
	case 7:
		nTextFormat|=DT_BOTTOM|DT_CENTER;
		break;
	case 8:
		nTextFormat|=DT_BOTTOM|DT_RIGHT;
		break;
	}
	pCI->SetTextFormat(nTextFormat);

	pCI->SetBackgroundColor(m_clrBackground);
	pCI->SetTextColor(m_clrText);
	pCI->SetNumberShade(m_nNumberShade);


	LOGFONT lf;
	if(m_font.GetLogFont(&lf))
		pCI->SetCaptionLogFont(&lf);

	if(m_fontSmall.GetLogFont(&lf))
		pCI->SetSmCaptionLogFont(&lf);

	ShowControls();
}
Ejemplo n.º 15
0
void COXCustomizeCaptionPage::GetVars(BOOL bLoad)
{
	CWnd* pWnd=AfxGetMainWnd();
	ASSERT(pWnd!=NULL && ::IsWindow(pWnd->GetSafeHwnd()));

	COXCaptionPainter* pCaptionPainter=m_captionPainterOrganizer.
		GetPainter(pWnd);
	BOOL bActive=(m_ctlComboCaptionState.GetCurSel()==NULL)?TRUE:FALSE;
	COXCaptionInfo* pCI=NULL;

	if(bLoad && (pCaptionPainter!=NULL))
	{
		pCI=pCaptionPainter->GetCaptionInfo(TRUE);
		ASSERT(pCI);
		m_ActiveInfo=*pCI;
		pCI=pCaptionPainter->GetCaptionInfo(FALSE);
		ASSERT(pCI);
		m_PassiveInfo=*pCI;
	}
	pCI=bActive?&m_ActiveInfo:&m_PassiveInfo;

	m_bGradient=pCI->GetGradient();
	m_nGradientAlgorithm=pCI->GetGradientAlgorithm();
	m_nGradientAlignment=pCI->GetGradientAlignment();

	UINT nTextFormat=pCI->GetTextFormat();
	if(nTextFormat&DT_END_ELLIPSIS)
		m_nTextEllipsis=1;
	else if(nTextFormat&DT_PATH_ELLIPSIS)
		m_nTextEllipsis=2;
	else
		m_nTextEllipsis=0;

	if(nTextFormat&DT_VCENTER)
	{
		if(nTextFormat&DT_CENTER)
			m_nTextAlignment=4;
		else if(nTextFormat&DT_RIGHT)
			m_nTextAlignment=5;
		else
			m_nTextAlignment=3;
	}
	else if(nTextFormat&DT_BOTTOM)
	{
		if(nTextFormat&DT_CENTER)
			m_nTextAlignment=7;
		else if(nTextFormat&DT_RIGHT)
			m_nTextAlignment=8;
		else
			m_nTextAlignment=6;
	}
	else
	{
		if(nTextFormat&DT_CENTER)
			m_nTextAlignment=1;
		else if(nTextFormat&DT_RIGHT)
			m_nTextAlignment=2;
		else
			m_nTextAlignment=0;
	}

	m_clrBackground=pCI->GetBackgroundColor(m_nCaptionState==0 ? TRUE : FALSE);
	

	m_clrText=pCI->GetTextColor(m_nCaptionState==0 ? TRUE : FALSE);
	
	m_clrTextSmall=m_clrText;

	m_nNumberShade=pCI->GetNumberShade();

	LOGFONT lf;
	VERIFY(pCI->GetCaptionLogFont(&lf));
	if((HFONT)m_font!=NULL)
		m_font.DeleteObject();
	VERIFY(m_font.CreateFontIndirect(&lf));

	VERIFY(pCI->GetSmCaptionLogFont(&lf));
	if((HFONT)m_fontSmall!=NULL)
		m_fontSmall.DeleteObject();
	VERIFY(m_fontSmall.CreateFontIndirect(&lf));

	UpdateData(FALSE);

	ShowControls();
}
Ejemplo n.º 16
0
Bool PaletteSubDialog::Command(Int32 id,const BaseContainer &msg)
{
	GeDynamicArray<Palette> pals;
    Palette pal;
    Filename fn;
    switch (id)
    {
		case 3:
            switch(msg.GetInt32(BFM_ACTION_VALUE)){
                case ACTION_NEW:
                    pal.SetColor(0, Color(0.f, 0.f, 0.f).SetSource(COLOR_SOURCE_DISPLAY));
                    id = Palette::AddPalette(pal);
                    m_controlsShown = FALSE;
                    LoadPalette(id);
                    SaveSettings();
                    Palette::UpdateAll();
                    return TRUE;
                case ACTION_LOAD:
                    if(fn.FileSelect(FILESELECTTYPE_ANYTHING, FILESELECT_LOAD, "Load")){
                        String s = fn.GetString();
                        if(Palette::LoadASEFile(s, pal)){
                            id = Palette::AddPalette(pal);
                            m_controlsShown = FALSE;
                            LoadPalette(id);
                            SaveSettings();
                            Palette::UpdateAll();
                        }
                    }
                    return TRUE;
                case ACTION_SAVE:
                    if(fn.FileSelect(FILESELECTTYPE_ANYTHING, FILESELECT_SAVE, "Save", "ase")){
                        String s = fn.GetString();
                        Palette::SaveASEFile(s, m_palette);
                    }
                    return TRUE;
                case ACTION_LABEL:
                    ShowControls(!m_showControls);
                    return TRUE;
                    
            }
            if(msg.GetInt32(BFM_ACTION_VALUE) >= ACTION_COUNT){
                m_controlsShown = FALSE;
                LoadPalette(msg.GetInt32(BFM_ACTION_VALUE)-ACTION_COUNT);
                SaveSettings();
            }
            return TRUE;
        case IDC_LAYOUT_DIRECTION:
            m_controlsShown = FALSE;
            LoadPalette(m_paletteID);
            SaveSettings();
            break;
        case IDC_ROWS:
            PaletteLayout();
            SaveSettings();
            break;
        case IDC_LABELCHECKBOX:
            GetBool(m_labelCheckArea, m_showLabel);
            LoadPalette(m_paletteID);
            SaveSettings();
            break;
        case IDC_NAME:
            if(m_nameArea != NULL){
                GetString(m_nameArea, m_palette.m_name);
                Palette::SetPaletteName(m_paletteID, m_palette.m_name);
                LoadPalette(m_paletteID);
            }
            break;
        case IDC_HIDE:
            ShowControls(FALSE);
            break;
        case IDC_SEARCHTEXT:
            PaletteLayout();
            SaveSettings();
            break;
        case IDC_CREATEMATERIAL:
            {
				Bool linkColors;
				GetBool(m_linkColor,linkColors);
                for(Int32 i=m_palette.m_colors.GetCount()-1;i>=0;--i){
                    BaseMaterial *mat = BaseMaterial::Alloc(Mmaterial);
                    String name = "PaletteMaterial";
                    if(m_palette[i].m_name != ""){
                        name = m_palette[i].m_name;
                    }
                    mat->SetName(name);
                    if(mat != nullptr){
                        BaseChannel *chan = mat->GetChannel(CHANNEL_COLOR);
                        if(chan != nullptr){
                            BaseContainer bc;
							if(linkColors){
								bc.SetInt32(BASECHANNEL_SHADERID, PALETTE_SHADER_ID);
								chan->SetData(bc);
								BaseShader *bs = chan->GetShader();
								BaseContainer* data = bs->GetDataInstance();
								data->SetInt32(PALETTESHADER_PALETTE_ID, 1+m_paletteID);
								data->SetInt32(PALETTESHADER_COLOR_ID, 1+i);
							} else {
								// Color Shader ID: 5832
								bc.SetInt32(BASECHANNEL_SHADERID, 5832);
								chan->SetData(bc);
								BaseShader *bs = chan->GetShader();
								BaseContainer* data = bs->GetDataInstance();
								
								data->SetVector(COLORSHADER_COLOR , m_palette.m_colors[i].AsVector());
							}
                            GetActiveDocument()->InsertMaterial(mat);
                            EventAdd();
                        }
                    }
                }
            }
            break;
		default:
			break;
    }
    return GeDialog::Command(id,msg);
}
Ejemplo n.º 17
0
//////////////////////////////////////////////////////////////////////////
// NAME : OnBtnNetworkLoad
// PARM : void
// RETN : void
// DESC : 전파버튼(Load수) 클릭 => 추천검색어 상태로 바꾸기. 
// DATE : 2005-12-29 coded by lizzy, origin
//////////////////////////////////////////////////////////////////////////
void CDlg_Search::OnBtnNetworkLoad() 
{
    SetCurrType(TYPE_SRCH_RCMMWORD);
    ShowControls();
}