Beispiel #1
0
void ThumbItem::InitCaption(bool get_caption)
{
    if (!HasCaption() && get_caption)
        SetCaption(GalleryUtil::GetCaption(m_path));
    if (!HasCaption())
        SetCaption(m_name);
}
void EclButton::SetProperties ( const char *_name, int _x, int _y, int _w, int _h,
		 	   				    const UnicodeString &_caption, const UnicodeString &_tooltip )
{
    if ( strlen(_name) > SIZE_ECLBUTTON_NAME )
    {
    }
    else
    {
        strcpy ( m_name, _name );
    }

	m_x = _x;
	m_y = _y;
	m_w = _w;
	m_h = _h;

	if ( !&_caption )
	{
		// Could use LANGUAGEPHRASE here instead, but that's cross projecs, so probably shouldn't...
		SetCaption( UnicodeString(_name) );
	}
	else
	{
		SetCaption ( _caption );
	}

	SetTooltip ( _tooltip );
	
}
Beispiel #3
0
    void Render( int realX, int realY, bool highlighted, bool clicked )
    {
        if( g_app->GetGame()->m_winner != -1 ) return;
        if( g_app->GetWorld()->AmISpectating() ) return;

        int permitDefection = g_app->GetGame()->GetOptionValue( "PermitDefection" );
        if( permitDefection )
        {
            AlliancesWindow *parent = (AlliancesWindow *)m_parent;
            int teamId = parent->m_selectionTeamId;

            if( teamId == -1 ) return;
            
            Team *myTeam = g_app->GetWorld()->GetMyTeam();
            Team *thisTeam = g_app->GetWorld()->GetTeam(teamId);
        
            if( myTeam && thisTeam )
            {
                if( myTeam->m_allianceId == thisTeam->m_allianceId )
                {
                    if( myTeam == thisTeam )
                    {
                        // This is my team
                        if( g_app->GetWorld()->CountAllianceMembers(myTeam->m_allianceId) == 1 )
                        {
                            // I am the only member of this alliance, so theres nothing to do here
                            return;
                        }
                        SetCaption( "dialog_alliance_leave", true );
                        SetTooltip( "tooltip_alliance_leave", true );
                    }
                    else
                    {
                        // Another member of the same alliance
                        SetCaption( "dialog_alliance_kick", true );
                        SetTooltip( "tooltip_alliance_kick", true );
                    }
                }
                else if( myTeam->m_allianceId != thisTeam->m_allianceId )
                {
                    // A different (enemy) alliance
                    SetCaption( "dialog_alliance_join", true );
                    SetTooltip( "tooltip_alliance_join", true );
                }
            }
        
            InterfaceButton::Render( realX, realY, highlighted, clicked );
        }
    }
Beispiel #4
0
GUIButton::GUIButton()
{
	Init();
	SetCaption(NULL);
	SetCaptionFont(NULL);
	SetCaptionColor(DEFAULT_TEXT_COLOR);
}
Beispiel #5
0
	VOID ExportConsoleDialog::StartNewTask( const CHAR* strCaption, FLOAT fTaskPercentOfWhole )
	{
		SetCaption( strCaption );
		m_fCurrentTaskMin += m_fCurrentTaskSize;
		m_fCurrentTaskSize = fTaskPercentOfWhole;
		SetProgress( 0 );
	}
void CTestGame::Init()
{
    CGame::Init();

    SetCaption("Test Game");
    mouse->SetVisible(false);

    //load image
    //mysurface = CSurface::Load("hi.png");
    #define width 256
    #define height 256
    mysurface = CSurface::CreateSurface(width,height);

    for(int y = 0; y < height; y++)
    {
        for(int x = 0; x < width; x++)
        {
            mysurface->SetPixel(x,y,x|y);
        }
    }

    #undef width
    #undef height

    //map inputs
    show = new CInput(MODE_TOGGLE);

    if(usingGamepad)
        gamepad->Map(show,GAMEPAD_A);
}
		/*=============================================================================
		-- Sets the caption of the text in the middle.
		=============================================================================*/
		void ButtonCaption::SetCaption(String caption)
		{
			mCaption = caption;
			WeakPtr<Text> text = DynamicPtrCast<Text>(GetChild(IEI_BUTTONCAPTION_TEXT).lock());

			if (!text.expired())
			{
				text.lock()->SetText(caption);
				Font *font = text.lock()->GetFont();

				unsigned width = (unsigned)font->GetTextLengthPx(mCaption.GetStd());
				unsigned height = (unsigned)font->GetCharHeightPx();


				//clip any characters that don't fit inside from the text element
				while (width > GetWidth())
				{
					mCaption.Remove(mCaption.Size()-1,mCaption.Size());
					SetCaption(mCaption);
					width = (unsigned)font->GetTextLengthPx(mCaption.GetStd());
				}

				//properly center the text
				text.lock()->SetRelPos( Vector2D<int>((GetWidth()-width)/2, (GetHeight()-height)/2) );
			}
		}
void CHomeLibraryBox::OnSkinChange()
{
	if ( m_pDocument ) delete m_pDocument;
	m_pDocument = NULL;
	m_pdLibraryFiles = m_pdLibraryVolume = m_pdLibraryHashRemaining = NULL;

	SetCaptionmark( _T("CHomeLibraryBox.Caption") );

	CXMLElement* pXML = Skin.GetDocument( _T("CHomeLibraryBox") );
	if ( pXML == NULL ) return;

	SetCaption( pXML->GetAttributeValue( _T("title"), _T("Library") ) );
	HICON hIcon = CoolInterface.ExtractIcon( IDR_LIBRARYFRAME, Settings.General.LanguageRTL );
	if ( hIcon ) SetIcon( hIcon );

	m_pDocument = new CRichDocument();

	CMap< CString, const CString&, CRichElement*, CRichElement* > pMap;
	if ( ! m_pDocument->LoadXML( pXML, &pMap ) ) return;

	pMap.Lookup( _T("LibraryFiles"), m_pdLibraryFiles );
	pMap.Lookup( _T("LibraryVolume"), m_pdLibraryVolume );
	pMap.Lookup( _T("LibraryHashRemaining"), m_pdLibraryHashRemaining );

	SetDocument( m_pDocument );

	Update();

	// Update Dropshadow	(Note: Caused app freeze when allowing hovered item during skin change)
	m_wndTip.DestroyWindow();
	m_wndTip.Create( this, &Settings.Interface.TipLibrary );
}
Beispiel #9
0
CWebWindow::CWebWindow(CWnd* pParent /*=NULL*/)
: WEB_WINDOW_PARENT(CWebWindow::IDD, pParent)
{
	//{{AFX_DATA_INIT(CWebWindow)
	//}}AFX_DATA_INIT
	m_bChild = FALSE;
	m_bAutoKill = FALSE;
	m_bResizable = TRUE;
	m_pMessageParent = NULL;
	m_pWebCustomizer = NULL;
	m_dwSessionCookie = 0;
	m_SendStatus = 0;
	m_Handle = 0;
	m_pXMLDoc = NULL;
	SetCaption(RGB(0,0,0),RGB(0,0,0),0);
	m_bQueryAttachXML = FALSE;
	m_rBrowser.SetRectEmpty();
	m_rWindow.SetRectEmpty();
	m_rTarget.SetRectEmpty();
	m_nIEVersion = 0;
	m_bBrowserRect = FALSE;
	m_bIEBack = m_bIEForward = m_bIEStop = m_bIERefresh = FALSE;
	m_InWindowDropTarget	=	NULL;
	m_bCatchNavigate	=	TRUE;
	m_bCatchWindowOpen	=	TRUE;
	m_bFileDownload = FALSE;
	m_nFileDownload = -1;
	m_bNavigateStarted = FALSE;
}
Beispiel #10
0
////////////////////////////////////////////////////////////
// TViewWallTextureDialog
// -----------------
//
void TViewWallTextureDialog::SetupWindow ()
{
	TViewBitmapListDialog::SetupWindow();

	SetCaption ("Viewing Wall textures");
	pChooseStatic->SetCaption ("Choose texture name:");

	// Insert wall textures names in list box
	assert (pBitmapList->IsWindow());

	//BOOL ForgetInfo = FALSE;
	if ( NumWTexture <= 0 )
	{
		ReadWTextureInfo();
		//ForgetInfo = TRUE;
	}
	assert (WTexture != NULL);

	pBitmapList->ClearList();

	// Add Wall texture names (except the first: "-")
	for (SHORT i = 1 ; i < NumWTexture ; i++)
	{
		assert (WTexture[i] != NULL);
		pBitmapList->AddString (WTexture[i]->Name);
	}

//	if ( ForgetInfo == TRUE )
//		ForgetWTextureInfo();
}
Beispiel #11
0
void VDUINumericLabelW32::SetValue(int v) {
	if (v != mValue) {
		mValue = v;

		SetCaption(VDswprintf(mFormat.c_str(), 1, &v).c_str());
	}
}
Beispiel #12
0
bool CProgressThreadDlg::ExecuteFunctionWithProgressDialog(ProgressFunctionType* pfnFunction,
    const CString& sProgressTitle,
    int nSteps,
    void* pData,
    int nPriority)
{
  SetCaption(sProgressTitle);
  SetSteps(nSteps);
  CProgressThreadInfo Info;
  Info.m_pStatusDlg = this;
  Info.m_pfnFunction = pfnFunction;
  Info.m_pData = pData;
  m_pThread = AfxBeginThread(ProgressDialogWorkerThread, &Info, nPriority, 0, CREATE_SUSPENDED);

  // If the thread failed to create itself
  if (m_pThread == NULL) {
    ASSERT(0);
    return false;
  }

  // Start timer
  m_timeStart = CTime::GetCurrentTime();
  m_timeEnd = m_timeStart;

  // bring up the dialog modal (thread will close it for us)
  DoModal();

  return true;
}
Beispiel #13
0
WndForm::WndForm(SingleWindow &_main_window,
                 const TCHAR *Caption,
                 int X, int Y, int Width, int Height,
                 const WindowStyle style):
  main_window(_main_window),
  mModalResult(0),
  mColorTitle(Color::YELLOW),
  mhTitleFont(&Fonts::MapBold),
  mOnTimerNotify(NULL), mOnKeyDownNotify(NULL)
{
  set(main_window, X, Y, Width, Height, add_border(style));

  // Create ClientWindow

  SetBackColor(Color(0xDA, 0xDB, 0xAB));

  WindowStyle client_style;
  client_style.control_parent();
  client_area.set(*this, mClientRect.left, mClientRect.top,
                  mClientRect.right - mClientRect.left,
                  mClientRect.bottom - mClientRect.top, client_style);
  client_area.SetBackColor(GetBackColor());

  cbTimerID = set_timer(1001, 500);

  SetCaption(Caption);

#if !defined(ENABLE_SDL) && !defined(NDEBUG)
  ::SetWindowText(hWnd, mCaption);
#endif
}
Beispiel #14
0
emTestPanel::TkTestGrp::TkTestGrp(ParentArg parent, const emString & name)
	: emTkGroup(parent,name)
{
	SetCaption("Toolkit Test");
	EnableAutoExpansion();
	SetAutoExpansionThreshold(900.0);
}
void AboutWindow::Initialise (HWND hWnd, unsigned int uID)
{	
	// Make the ID global
	m_ID = uID;
	m_parenthwnd = hWnd;
	//m_hwnd = hWnd;

	// Temporary string value for uID
	char szID[SIZE_STRING];
	ZeroMemory (szID, SIZE_STRING);

	SetParentHWND (hWnd);
	SetBgColor (GetSysColor (COLOR_BTNFACE));
	SetCaption (TEXT ("About"));
	SetWindowStyle (FS_STYLESTANDARD);

	// Create the class name
	strcat_s (m_szClassname, SIZE_STRING, "ABOUTWindowClass");
	sprintf_s (szID, SIZE_STRING, "%d", uID);
	strcat_s (m_szClassname, SIZE_STRING, szID);


	CreateAppWindow (m_szClassname, 70, 0, 397, 200, true);
	m_uihandler.SetWindowProperties (0, 0, 299, 0, GetSysColor (COLOR_BTNFACE));
	SetWindowPosition (FS_CENTER);
	Show ();
}
void CTestGame::Init()
{
    CGame::Init();

    SetCaption("Test Game");
    mouse->SetVisible(false);

    //create game space
    SDL_Rect bounds;
    bounds.x = 0;
    bounds.y = 0;
    bounds.w = GetScreenWidth();
    bounds.h = GetScreenHeight();
    space = new CEntitySpace(bounds);

    //create entity
    CSurface* surf = CSurface::Load("smile.png");
    surf->SetColorKey(255,0,106);
    entity = new CEntity(surf,10.0,false);
    entity->position.x = entity->GetWidth()/2;
    entity->position.y = entity->GetHeight()/2;

    space->Add(entity);

    //create segments
    seg = new CSegment(SDL_MapRGB(Display_Surface->GetSDLSurface()->format,
                                            0,0,0));
    seg->v1.x = 0;
    seg->v1.y = 500;
    seg->v2.x = 500;
    seg->v2.y = 500;

    space->Add(seg);
}
bool Document :: SaveAs()
{
	wStdFileSaveAsDialog fdlg;
	bString	oldfname = fname;
	bool	oldsaveas = saveas;

	fdlg.ChangeStyle(FdaCenter | FdaHelpButton);
	fdlg.SetInitialDrive('C');
	if (fdlg.CreateWindow(this) == DidOK)
	{
		fname = fdlg.GetFirstFile();
		saveas = FALSE;
		if (Save())
		{
			SetCaption(fname);
			Activate((wActivateMsg&)wMessage(WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hWindow()));
			return TRUE;
		}
		else
		{
			fname = oldfname;
			saveas = oldsaveas;
			return FALSE;
		}
	}
	return FALSE;
}
Beispiel #18
0
void
TopWindow::Create(const TCHAR *text, PixelSize size,
                  TopWindowStyle style)
{
  invalidated = true;

  delete screen;
  screen = new TopCanvas();

#if defined(ENABLE_SDL) && (SDL_MAJOR_VERSION >= 2)
#ifdef UNICODE
  const WideToUTF8Converter text2(text);
#else
  const char* text2 = text;
#endif
  screen->Create(text2, size, style.GetFullScreen(), style.GetResizable());
#else
  screen->Create(size, style.GetFullScreen(), style.GetResizable());
#endif

  if (!screen->IsDefined()) {
    delete screen;
    screen = nullptr;
    return;
  }

  ContainerWindow::Create(nullptr, screen->GetRect(), style);

#if defined(ENABLE_SDL) && (SDL_MAJOR_VERSION < 2)
  SetCaption(text);
#endif
}
Beispiel #19
0
	CGameWindow()
		: CFKWindow( 640,480,false )
		, m_Player( Graphics(), Audio() )
		, m_Font( Graphics(), FK2DEngine::DefaultFontName(), 24 )
		, m_nFps( 0 )
		, m_nLastFps( 0 )
	{
		SetCaption( L"自由骑士笃志引擎:DEMO1" );

		std::wstring szFileName = FK2DEngine::ShareResourcePrefix() + L"rc/media/Space.png";
		m_pBackgroundImage.reset( new FK2DEngine::CImage( Graphics(), szFileName, false ) );

		szFileName = FK2DEngine::ShareResourcePrefix() + L"rc/media/Star.png";
		FK2DEngine::ImagesFromTiledBitmap( Graphics(), szFileName, 25, 25, false, m_StarAnim );

		m_Player.Warp( 320, 240 );

		//szFileName = FK2DEngine::ShareResourcePrefix() + L"avgRc\\Attack.cur";
		//SetNewCursor( szFileName );

		szFileName = FK2DEngine::ShareResourcePrefix() + L"avgRc\\AnimCursor.bmp";
		m_pCursorBitmap = LoadImageFile( szFileName );
		SSAnimationCursorManager::Instance()->AddCursor( m_pCursorBitmap, L"默认鼠标", 32, 32 );
		SSAnimationCursorManager::Instance()->SetAnimCursor( L"默认鼠标" );
		SSAnimationCursorManager::Instance()->Enable( true );
	}
void TextWindow::Initialise (HWND hWnd, unsigned int uID)
{	
	// Make the ID global
	m_ID = uID;
	m_parenthwnd = hWnd;
	//m_hwnd = hWnd;

	// Temporary string value for uID
	char szID[SIZE_STRING];
	ZeroMemory (szID, SIZE_STRING);

	SetParentHWND (hWnd);
	SetBgColor (GetSysColor (COLOR_BTNFACE));
	SetCaption (TEXT ("Decrypted Text"));
	SetWindowStyle (FS_STYLESTANDARD);

	// Create the class name
	strcat_s (m_szClassname, SIZE_STRING, "TextWindowClass");
	sprintf_s (szID, SIZE_STRING, "%d", uID);
	strcat_s (m_szClassname, SIZE_STRING, szID);

	if (m_binitialised == false) {
		CreateAppWindow (m_szClassname, 70, 0, 400, 550, true);
		m_uihandler.SetWindowProperties (0, 0, 300, 0, RGB (230, 230, 240));
		SetWindowPosition (FS_CENTER);
		m_binitialised = true;
	}

	Show ();
}
Beispiel #21
0
CRComboExtra*	CRComboExtra::SetList(int resid,int len)
{
	SetCaption(LoadResString(resid));
	while(len--)
		AddString(LoadResString(resid++));
	return this;	 //neat trick used by the streams stuff...
}
Beispiel #22
0
////////////////////////////////////////////////////////////
// TViewFloorTextureDialog
// -----------------
//
void TViewFloorTextureDialog::SetupWindow ()
{
	TViewBitmapListDialog::SetupWindow();

	SetCaption ("Viewing Floor/Ceiling textures");
	pChooseStatic->SetCaption ("Choose texture name:");

	// Insert wall textures names in list box

	BOOL ForgetInfo = FALSE;
	if ( NumFTexture <= 0 )
	{
		ReadFTextureInfo();
		ForgetInfo = TRUE;
	}
	assert (FTexture != NULL);

	assert (pBitmapList->IsWindow());
	pBitmapList->ClearList();

	// Add texture names
	for (SHORT i = 0 ; i < NumFTexture ; i++)
	{
		assert (FTexture[i] != NULL);
		pBitmapList->AddString (FTexture[i]->Name);
	}

//	if ( ForgetInfo == TRUE )
//		ForgetFTextureInfo();
}
Beispiel #23
0
////////////////////////////////////////////////////////////
// TDisplayBitmapDialog
// -------------------
//
int TDisplayBitmapDialog::SelectBitmap2 (const char *str)
{
	pBitmapControl->SelectBitmap2 (str);

	SetCaption(str);

	return 1;
}
Beispiel #24
0
void
TaskManagerDialog::UpdateCaption()
{
  StaticString<128> title;
  title.Format(_T("%s - %s"), _("Task Manager"),
               tab_bar->GetButtonCaption(tab_bar->GetCurrentPage()));
  SetCaption(title);
}
Beispiel #25
0
void CXTPPopupItem::SetMarkupText(LPCTSTR str)
{
    m_pControl->EnableMarkup(TRUE);

    m_bHyperLink = FALSE;

    SetCaption(str);
}
Beispiel #26
0
GUIButton::GUIButton(string name)
{
	Init();
	SetCaption(NULL);
	SetCaptionFont(NULL);
	SetCaptionColor(DEFAULT_TEXT_COLOR);
	SetName(name);
}
Beispiel #27
0
void MainWidget::userData()
{
  rda->setUser(rda->ripc()->user());
  for(unsigned i=0;i<panel_slots.size();i++) {
    panel_slots[i]->setUser(rda->user());
  }
  SetCaption();
  rda->ripc()->sendOnairFlag();
}
Beispiel #28
0
void MainWidget::userData()
{
  if(rduser!=NULL) {
    delete rduser;
  }
  rduser=new RDUser(rdripc->user());
  SetCaption();
  rdripc->sendOnairFlag();
}
Beispiel #29
0
//===========================================================================
__fastcall TfrmMain::TfrmMain(TComponent* Owner)
        : TForm(Owner)
{
    Application->Title            = ProjectCaption;
    pBGround     ->DoubleBuffered = true;
    frmMain      ->DoubleBuffered = true;

    SetCaption();
}
void TInput1Dialog::SetupWindow ()
{
	TDialog::SetupWindow();
	::CenterWindow (this);

	SetCaption (Title);
	pPromptStatic->SetText (Prompt);
	pInput1Edit->SetText (Buffer1);
}