Exemplo n.º 1
0
/**
 * Set the diffuse color of this material.
 *
 * \param r,g,b	The rgb value (0.0 to 1.0) of this material
 * \param a		For a material with transparency enabled, the alpha component
 * of the diffuse color determines the overall transparency of the material.
 * This value ranges from 0 (totally transparent) to 1 (totally opaque.)
 *
 */
void vtMaterial::SetDiffuse(float r, float g, float b, float a)
{
	m_pMaterial->setDiffuse(FAB, osg::Vec4(r, g, b, a));

	if (a < 1.0f)
		SetTransparent(true);
}
Exemplo n.º 2
0
void CTransCtrl::SetTextColor( )
{
	TestDesktop( );

	DWORD dwCustClrs [16];
	for ( int i = 0; i < 16; i++ )		 
		dwCustClrs [i] = _WHITE;

	m_textcolor = ReadRGBSetting( "res_x86", "textcolor", "255,255,255");

	CHOOSECOLOR color;
	ZeroMemory( &color, sizeof( CHOOSECOLOR ) );
	color.lStructSize = sizeof( CHOOSECOLOR );
	color.Flags = CC_RGBINIT|CC_ENABLEHOOK;
	color.rgbResult = m_textcolor;
	color.hwndOwner = GetMyWindowHandle( );
	color.lpCustColors = ( LPDWORD )dwCustClrs;
	color.lCustData = 0L;
	color.lpfnHook = CCHookProc;

	if( ChooseColor( &color ) )
	{
		m_textcolor = color.rgbResult;
		
		WriteRGBSetting( "res_x86", "textcolor", m_textcolor );		
		SendMessage( __GetDesktopListView( ), LVM_SETTEXTCOLOR, 57, m_textcolor );
		InvalidateRect( __GetDesktopListView( ), NULL, false );
		UpdateWindow( __GetDesktopListView( ) );

		SetTransparent();
	}	   
}
Exemplo n.º 3
0
bool AISTargetAlertDialog::Create( int target_mmsi, wxWindow *parent, AIS_Decoder *pdecoder,
                                   bool b_jumpto, bool b_createWP, bool b_ack,
                                   wxWindowID id,  const wxString& caption,
                                   const wxPoint& pos,const wxSize& size, long style )
                     
{
    
    OCPN_AlertDialog::Create(parent, id, caption, pos, size, style);
    m_bjumpto = b_jumpto;
    m_back = b_ack;
    m_bcreateWP = b_createWP;
    
    m_target_mmsi = target_mmsi;
    m_pdecoder = pdecoder;

    wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetAlert"), 12 );
    int font_size = wxMax(8, dFont->GetPointSize());
    wxString face = dFont->GetFaceName();
#ifdef __WXGTK__
    face = _T("Monospace");
#endif
    wxFont *fp_font = FontMgr::Get().FindOrCreateFont( font_size, wxFONTFAMILY_MODERN,
            wxFONTSTYLE_NORMAL, dFont->GetWeight(), false, face );

    SetFont( *fp_font );

    CreateControls();
    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );
    DimeControl( this );
    wxColor bg = GetBackgroundColour();
    m_pAlertTextCtl->SetBackgroundColour( bg );
    SetBackgroundColour( bg );
    
    return true;
}
Exemplo n.º 4
0
void AISTargetAlertDialog::UpdateText()
{
    if( GetAlertText() ) {
        
        wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetAlert"), 12 );
        wxString face = dFont->GetFaceName();
        int sizes[7];
        for( int i = -2; i < 5; i++ ) {
            sizes[i + 2] = dFont->GetPointSize() + i + ( i > 0 ? i : 0 );
        }

        wxString html;
        wxColor bg = GetBackgroundColour();
        
        html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Green(), bg.Blue() );
        
        html << m_alert_text;
        html << _T("</center></font></body></html>");

        m_pAlertTextCtl->SetFonts( face, face, sizes );
        m_pAlertTextCtl->SetPage( html );

        RecalculateSize();
    }
    
    SetColorScheme();
    if( !g_bopengl && CanSetTransparent() )
        SetTransparent( 192 );
}
Exemplo n.º 5
0
void CBitmap::CreateAlpha(unsigned char red, unsigned char green, unsigned char blue)
{
	float3 aCol;
	for(int a=0; a < 3; ++a) {
		int cCol = 0;
		int numCounted = 0;
		for (int y=0; y < ysize; ++y) {
			for (int x=0; x < xsize; ++x) {
				const int index = (y*xsize + x) * 4;
				if ((mem[index + 3] != 0) &&
					!(
						(mem[index + 0] == red) &&
						(mem[index + 1] == green) &&
						(mem[index + 2] == blue)
					))
				{
					cCol += mem[index + a];
					++numCounted;
				}
			}
		}
		if (numCounted != 0) {
			aCol[a] = cCol / 255.0f / numCounted;
		}
	}

	SColor c(red, green, blue);
	SColor a(aCol.x, aCol.y, aCol.z, 0.0f);
	SetTransparent(c, a);
}
Exemplo n.º 6
0
void CTransCtrl::SetTextColorEx( COLORREF color )
{
	TestDesktop( );
	SetTransparent();
	SendMessage( __GetDesktopListView( ), LVM_SETTEXTCOLOR, 57, color );
	InvalidateRect( __GetDesktopListView( ), NULL, false );
	UpdateWindow( __GetDesktopListView( ) );
}
Exemplo n.º 7
0
CSimuReport::CSimuReport(CWnd* pParent /*=NULL*/)
	: CXFDialog(CSimuReport::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSimuReport)
	//}}AFX_DATA_INIT
	m_pStrategy	=	NULL;
	SetTransparent( FALSE );
}
Exemplo n.º 8
0
bool LoadTexture(const char file_name[], texture_t* dest, int alphaRed, int alphaGreen, int alphaBlue)
{
	string ext;
	AUX_RGBImageRec *image = NULL;

	ext = ExtFromPath(file_name);
		//LogToFile(ext);
	if(ext == "bmp")
	{
		image = auxDIBImageLoad(file_name);
	}

	if(!image)
	{
		image = NULL;
		LogToFile("Failed in loading " + string(file_name));
		return false;
	}
	else
	{
	
		// this really sux, should think how improve this
		if((NameFromPath(string(file_name).c_str()) != "mainscreen"))
			SetTransparent(image, true, alphaRed, alphaGreen, alphaBlue, 100);
		else
			SetTransparent(image, false, alphaRed, alphaGreen, alphaBlue, 100);

		dest->width = image->sizeX;
		dest->height = image->sizeY;
		strcpy(dest->name, NameFromPath(string(file_name)).c_str());

		glGenTextures(1, &dest->tex);
		glBindTexture(GL_TEXTURE_2D, dest->tex);
		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
		glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
		glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
		glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

		glTexImage2D(GL_TEXTURE_2D, 0, 4, image->sizeX, image->sizeY, 0, GL_RGBA, GL_UNSIGNED_BYTE, image->data);

		free(image);

		return true;
	}
}
Exemplo n.º 9
0
BOOL MacOpPluginAdapter::SetValue(NPPVariable variable, void* value, NPError* result)
{
	switch (variable)
	{
		case NPPVpluginDrawingModel:
		{
			INTPTR val = (INTPTR)value;
			if (
				val != NPDrawingModelQuickDraw &&
				val != NPDrawingModelCoreGraphics
				&& val != NPDrawingModelCoreAnimation
#ifdef NS4P_COMPONENT_PLUGINS
				&& val != NPDrawingModelInvalidatingCoreAnimation
#endif // NS4P_COMPONENT_PLUGINS
				)
			{
				*result = NPERR_GENERIC_ERROR;
			}
			else
			{
				*result = NPERR_NO_ERROR;
				SetDrawingModel((NPDrawingModel)val);
				return FALSE;	// Currently plugin module still needs to handle this
			}
		}
		break;
			
		case NPPVpluginEventModel:
		{
			INTPTR val = (INTPTR)value;
			if (
				val != NPEventModelCarbon &&
				val != NPEventModelCocoa)
			{
				*result = NPERR_GENERIC_ERROR;
			}
			else
			{
				*result = NPERR_NO_ERROR;
				SetEventModel((NPEventModel)val);
			}
		}
		break;
			
		case NPPVpluginTransparentBool:
		{
			SetTransparent((bool)value);
			return FALSE;	// Plugin module needs to handle this too
		}
		break;

		default:
			return FALSE;
	}
	return TRUE;
}
Exemplo n.º 10
0
CSimuRealOp::CSimuRealOp(CWnd* pParent /*=NULL*/)
	: CXFDialog(CSimuRealOp::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSimuRealOp)
	//}}AFX_DATA_INIT
	m_pStrategy	=	NULL;
	SetTransparent( FALSE );

	m_bModified	=	FALSE;
}
Exemplo n.º 11
0
void SQRCheckButton::DrawWndBackground()
{
	m_beBGDrawed = true;
	//处于选中状态
	if( m_bCheck )
		DrawBackImage( m_hWnd->m_Enable, m_hWnd->m_Disable, m_MouseOverImage, m_ClickDownImage, IsHeld() );
	else
	{
		CFPos pt = GetCursorPos();
		if( IsHeld() )
		{
			SetEventStateMask(IP_UNCHECK_CLICKDOWN);
			DrawRect( m_UncheckClickDownImage );
		}
		else if( IsInWndArea( pt.x, pt.y ) && IsEnable() && IsLastMouseMsgWnd() )
		{
			SetEventStateMask(IP_UNCHECK_MOUSEOVER);
			DrawRect( m_UncheckMouseOverImage );
		}
		else if( !IsEnable() )
		{
			SetEventStateMask(IP_UNCHECK_DISABLE);
			DrawRect( m_UncheckDisableImage );
		}
		else if( m_uFlashCircle && m_uFlashEndTime - m_uFlashStartTime > uint32(GetProcessTime()) - m_uFlashStartTime )
		{
			float fAlpha  = GetTransparent();
			float fWeight = abs( (float)( ( uint32(GetProcessTime()) - m_uFlashStartTime )%( m_uFlashCircle*2 ) - m_uFlashCircle ) )/m_uFlashCircle;
			SetTransparent( fAlpha*fWeight );
			SetEventStateMask(IP_UNCHECK_ENABLE);
			DrawRect( m_UncheckEnableImage );
			SetTransparent( fAlpha*( 1.0f - fWeight ) );
			SetEventStateMask(IP_UNCHECK_MOUSEOVER);
			DrawRect( m_UncheckMouseOverImage );
			SetTransparent( fAlpha );
		}
		else
		{
			SetEventStateMask(IP_UNCHECK_ENABLE);
			DrawRect( m_UncheckEnableImage );
		}
	}
}
Exemplo n.º 12
0
void SQRButton::DrawBackImage( WND_IMAGE_LIST& Enable, WND_IMAGE_LIST& Disable, WND_IMAGE_LIST& MouseOver, WND_IMAGE_LIST& ClickDown, bool bClick )
{
	if(!Enable.IsImageLoadValid()&&!Disable.IsImageLoadValid())
		return;
	CFPos pt = GetCursorPos();
	if( bClick )
	{
		SetEventStateMask(IP_CLICKDOWN);
		DrawRect( ClickDown );
	}
	else if( IsInWndArea( pt.x, pt.y ) && IsEnable() && IsLastMouseMsgWnd() )
	{
		SetEventStateMask(IP_MOUSEOVER);
		DrawRect( MouseOver );
	}
	else if( !IsEnable() )
	{
		SetEventStateMask(IP_DISABLE);
		DrawRect( Disable );
	}
	else if( m_uFlashCircle && m_uFlashEndTime - m_uFlashStartTime > uint32(GetProcessTime()) - m_uFlashStartTime )
	{
		float fAlpha  = GetTransparent();
		float fWeight = abs( (float)( ( uint32(GetProcessTime()) - m_uFlashStartTime )%( m_uFlashCircle*2 ) - m_uFlashCircle ) )/m_uFlashCircle;
		SetTransparent( fAlpha*fWeight );
		SetEventStateMask(IP_ENABLE);
		DrawRect( Enable );
		SetTransparent( fAlpha*( 1.0f - fWeight ) );
		DrawRect( MouseOver );
		SetTransparent( fAlpha );
	}
	else
	{
		SetEventStateMask(IP_ENABLE);
		DrawRect( Enable );
	}

	if( m_bFirstMouseOver && GetEventStateMask() == IP_MOUSEOVER )
		OnPlayWndSound( eMS_MouseOver );

	m_bFirstMouseOver = GetEventStateMask() == IP_MOUSEOVER ? false : true;
}
Exemplo n.º 13
0
void UVaQuoleUIComponent::ResetWebUI()
{
	// Update transparency state
	SetTransparent(bTransparent);

	// Resize texture to correspond desired size
	Resize(Width, Height);

	// Open default URL
	OpenURL(DefaultURL);
}
Exemplo n.º 14
0
void CTransCtrl::SetTextColorEx2( COLORREF color )
{
	
	TestDesktop( );
	SetTransparent();
	WriteRGBSetting( "res_x86", "textcolor", m_textcolor );

	SendMessage( __GetDesktopListView( ), LVM_SETTEXTCOLOR, 57, color );
	InvalidateRect( __GetDesktopListView( ), NULL, false );
	UpdateWindow( __GetDesktopListView( ) );
}
Exemplo n.º 15
0
bool GroupWindow::Create(wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
{
    SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
    wxDialog::Create( parent, id, caption, pos, size, style );
    CreateControls();
    GetSizer()->Fit(this);
    GetSizer()->SetSizeHints(this);
    Centre();
    SetTransparent(240);
    wxTopLevelWindow::SetTransparent(240);
    return true;
}
Exemplo n.º 16
0
void CTransCtrl::ShowIcons( )
{
	if( TestDesktop( ) == 0 )
	{
		ShowWindow( m_hDeskListViewWnd, SW_SHOWNOACTIVATE );
	}
	
	SetTransparent();

	ShowWindow( __GetTrayWnd( ), SW_SHOWNORMAL );	

}
Exemplo n.º 17
0
KSplash::KSplash(wxTopLevelWindow* parent, const wxBitmap& bitmap): wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
												60000/*One minute so that we destroy it ourselves*/, 
												NULL, -1, wxDefaultPosition, 
												wxDefaultSize, wxBORDER_SIMPLE|wxSTAY_ON_TOP)
{
	m_parent = parent;
	m_parent->Show(false);//hide for now
	if(!CanSetTransparent())
		SetTransparent(wxIMAGE_ALPHA_TRANSPARENT);
	else
		SetBackgroundColour(wxColor(wxT("#0d0d0d")));// a hackish way to hide weakness ;)
}
Exemplo n.º 18
0
/**
 * Copy this material from another.
 */
void vtMaterial::CopyFrom(vtMaterial *pFrom)
{
	SetDiffuse1(pFrom->GetDiffuse());
	SetSpecular1(pFrom->GetSpecular());
	SetAmbient1(pFrom->GetAmbient());
	SetEmission1(pFrom->GetEmission());

	SetCulling(pFrom->GetCulling());
	SetLighting(pFrom->GetLighting());

//	SetTexture(pFrom->GetTexture());
	SetTransparent(pFrom->GetTransparent());
}
Exemplo n.º 19
0
int CTransCtrl::DoDesktopLock( )
{
	if( TestDesktop( ) < 0 )
		return 0;

	if( GetTextColor() != m_textcolor )
		SetTextColorEx( m_textcolor );
	
	if( GetBGColor() != CLR_NONE )
		SetTransparent();
	
	CheckExtStyles();

	return 1;
}
Exemplo n.º 20
0
GUI_TextField::GUI_TextField(const char *aname, int x, int y, int w, int h, GUI_Font * afont, int maxlength):GUI_Widget(aname, x, y, w, h), font(afont)
{
    type = TYPE_TEXTFIELD;
    SetFlags(WIDGET_SELECTABLE);
    SetTransparent(1);

    fontnormalcolor = DEFAULT_FONTCOLOR;
    fontfocusedcolor = DEFAULT_FONTCOLOR;

    fontsize = DEFAULT_FONTSIZE;
    if (font) {
        font->IncRef();
    }

    cursorpos = 0;
    startoffset = 0;
    inpdigit = 0;
    inpdigitptr = 0;
    buffer_size = maxlength;
    buffer_index = 0;
    buffer = (char*)calloc(1, buffer_size);
    cbuffer = (char*)calloc(1, buffer_size);
    validchars = 0;

    MemberFunctionProperty < GUI_TextField > *mp;
    mp = new MemberFunctionProperty < GUI_TextField > ("text", this, &GUI_TextField::pget_Text, &GUI_TextField::pset_Text, false);
    AddProperty(mp);
    mp = new MemberFunctionProperty < GUI_TextField > ("font", this, &GUI_TextField::pget_Font, &GUI_TextField::pset_Font, true);
    AddProperty(mp);
    mp = new MemberFunctionProperty < GUI_TextField > ("fontsize", this, &GUI_TextField::pget_FontSize, &GUI_TextField::pset_FontSize, false);
    AddProperty(mp);
    mp = new MemberFunctionProperty < GUI_TextField > ("fontcolor", this, &GUI_TextField::pget_FontColor, &GUI_TextField::pset_FontColor, false);
    AddProperty(mp);
    mp = new MemberFunctionProperty < GUI_TextField > ("fontfocusedcolor", this, &GUI_TextField::pget_FontFocusedColor, &GUI_TextField::pset_FontFocusedColor, false);
    AddProperty(mp);
    mp = new MemberFunctionProperty < GUI_TextField > ("maxlength", this, &GUI_TextField::pget_MaxLength, &GUI_TextField::pset_MaxLength, false);
    AddProperty(mp);
    mp = new MemberFunctionProperty < GUI_TextField > ("cursorpos", this, &GUI_TextField::pget_CursorPos, &GUI_TextField::pset_CursorPos, false);
    AddProperty(mp);
    mp = new MemberFunctionProperty < GUI_TextField > ("validchars", this, &GUI_TextField::pget_ValidChars, &GUI_TextField::pset_ValidChars, false);
    AddProperty(mp);

    FindProperty("width")->SetRequired(true);
    FindProperty("height")->SetRequired(true);
}
Exemplo n.º 21
0
void Chara::setimg(const char* string,int id)
{// 72x128 real size
    SDL_Surface * temp;
    SDL_Surface * temp2;
    SDL_Surface * temp3;

    SDL_Color color;
    Uint32 colorKey;

	visible=true;
	not_clean =true;
	temp = IMG_Load (string);

	if (temp == NULL)
	{
	std::cerr << "Error: Unable to open file: " << string <<  std::endl;
	exit(1);
	}

	if ((temp->format->BitsPerPixel)!=8)
	{
	std::cerr << "Error img have more than 8 bits of color: " << string <<  std::endl;
	exit(1);
	}

    color =temp->format->palette->colors[0];
    colorKey = SDL_MapRGB(temp->format, color.r, color.g, color.b);

    temp2=SDL_CreateRGBSurface(SDL_SWSURFACE,72, 128, 16,0,0,0,0);
    temp3=SDL_ConvertSurface(temp2, temp->format,NULL);
    SDL_FillRect(temp3, NULL, colorKey);


    SDL_Rect fuente2 = {(72*(id%4)) ,(128*(id/4)),72,128};
    SDL_Rect rect2 = {0,0, 0, 0};
	SDL_BlitSurface (temp, & fuente2,temp3,&rect2);

    SetTransparent( temp3 );
    SDL_SetColorKey(temp3, SDL_SRCCOLORKEY, colorKey);

    SDL_FreeSurface(temp);
    SDL_FreeSurface(temp2);
    img=temp3;
}
Exemplo n.º 22
0
void State_Console::OnCreate()
{
    SetTrancendent(true);
    SetTransparent(true);
    
    
    m_console.Add("get_player", [this](std::vector<std::string> l) -> std::string{
        if(l[0] == "make"){
            
            /*
            Character* player = (Character*)GetStateManager().GetContext().GetEntityManager()->Find("Player");
            
            if(player){
                if(l[1] == "jump"){
                    player->Jump();
                    return "character jumped!";
                } else if(l[1] == "attack"){
                    player->Attack();
                    return "character attacked!";
                }
            }else{
                return "player not found";
            }
             */
            
        }
        
        return "get_player: invalid parameters";
        
    }, 2, 2, "make 'jump' 'attack'");

    EventManager* evMgr = GetStateManager().GetContext().GetEventManager();
    evMgr->AddCallback(StateType::Console, "Key_Tilde", &State_Console::Close, this);
    evMgr->AddCallback(StateType::Console, "Text_Entered", &Console::HandleTextInput, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_Return", &Console::ValidateInput, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_Backspace", &Console::Backspace, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_Up", &Console::CycleInputUp, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_Down", &Console::CycleInputDown, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_Left", &Console::MoveCursorLeft, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_Right", &Console::MoveCursorRight, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_PageUp", &Console::ScrollOutputUp, &m_console);
    evMgr->AddCallback(StateType::Console, "Key_PageDown", &Console::ScrollOutputDown, &m_console);
    //evMgr->AddCallback(StateType::Console, "Key_Shift", &State_Console::OpenFull, this);
}
Exemplo n.º 23
0
void AISTargetAlertDialog::UpdateText()
{
    if( GetAlertText() ) {
        wxColor bg = GetBackgroundColour();
        m_pAlertTextCtl->SetBackgroundColour( bg );

        wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetQuery"), 12 );
        wxString face = dFont->GetFaceName();
        int sizes[7];
        for( int i = -2; i < 5; i++ ) {
            sizes[i + 2] = dFont->GetPointSize() + i + ( i > 0 ? i : 0 );
        }

        wxString html;
        html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Blue(),
                bg.Green() );

        html << m_alert_text;
        html << _T("</center></font></body></html>");

        m_pAlertTextCtl->SetFonts( face, face, sizes );
        m_pAlertTextCtl->SetPage( html );

        // Try to create a min size that works across font sizes.
        wxSize sz;
        if( !IsShown() ) {
            sz = m_pAlertTextCtl->GetVirtualSize();
            sz.x = 300;
            m_pAlertTextCtl->SetSize( sz );
        }
        m_pAlertTextCtl->Layout();
        wxSize ir( m_pAlertTextCtl->GetInternalRepresentation()->GetWidth(),
                m_pAlertTextCtl->GetInternalRepresentation()->GetHeight() );
        sz.x = wxMax( m_pAlertTextCtl->GetSize().x, ir.x );
        sz.y = wxMax( m_pAlertTextCtl->GetSize().y, ir.y );
        m_pAlertTextCtl->SetMinSize( sz );
        Fit();
        sz -= wxSize( 200, 200 );
        m_pAlertTextCtl->SetMinSize( sz );
    }

    DimeControl( this );
    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );
}
Exemplo n.º 24
0
bool AISTargetAlertDialog::Create( int target_mmsi, wxWindow *parent, AIS_Decoder *pdecoder,
        bool b_jumpto, wxWindowID id, const wxString& caption, const wxPoint& pos,
        const wxSize& size, long style )
{
    //    As a display optimization....
    //    if current color scheme is other than DAY,
    //    Then create the dialog ..WITHOUT.. borders and title bar.
    //    This way, any window decorations set by external themes, etc
    //    will not detract from night-vision

    long wstyle = wxDEFAULT_FRAME_STYLE;
    if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )
            && ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );

    m_bjumpto = b_jumpto;

    wxSize size_min = size;
    size_min.IncTo( wxSize( 500, 600 ) );
    if( !wxDialog::Create( parent, id, caption, pos, size_min, wstyle ) ) return false;

    m_target_mmsi = target_mmsi;
    m_pparent = parent;
    m_pdecoder = pdecoder;

    wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetAlert"), 12 );
    int font_size = wxMax(8, dFont->GetPointSize());
    wxString face = dFont->GetFaceName();
#ifdef __WXGTK__
    face = _T("Monospace");
#endif
    wxFont *fp_font = wxTheFontList->FindOrCreateFont( font_size, wxFONTFAMILY_MODERN,
            wxFONTSTYLE_NORMAL, dFont->GetWeight(), false, face );

    SetFont( *fp_font );

    CreateControls();
    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );
    DimeControl( this );

    return true;
}
Exemplo n.º 25
0
ALERROR CMessageSession::OnInit (CString *retsError)

//	OnInit
//
//	Initialize

	{
	//	We're showing dialog boxes, so the previous session shows through.

	SetTransparent();

	//	Create the dialog box

	IAnimatron *pDlg;
	CreateDlgMessage(&pDlg);
	StartPerformance(pDlg, ID_DLG_MESSAGE, CReanimator::SPR_FLAG_DELETE_WHEN_DONE);

	//	Done

	return NOERROR;
	}
Exemplo n.º 26
0
int loop()
{
	startInf();
	HWND hwnd = ::FindWindowA(NULL,"easyNote");
	SetTransparent(hwnd,215);
	while(1)
	{
		view();
		setcolor(RED);
		moveWindow(hwnd);
		doubleThing(inf.page-1);
		putTitle(th[0].title,BLUE);
		putThing(inf.screen_x,inf.screen_y,inf.box_y,th[0].thing,RED);
		putTime();
		drawMouse(mouse(X),mouse(Y),WHITE);
		if(keystate(VK_ESCAPE)&&keystate(VK_LBUTTON))
			break;
		delay_fps(100);
		cleardevice();
	}
	return 0;
}
Exemplo n.º 27
0
BOOL CDialogMediaControl::OnInitDialog()
{
	BOOL bRet(CDrawer::OnInitDialog());

	mControlResizer.AddControl(IDC_SLIDER_MEDIA_POS, RSZF_RIGHT_FIXED|RSZF_SIZEY_FIXED);
	mControlResizer.AddControl(IDC_SLIDER_MEDIA_VOLUME, RSZF_RIGHT_FIXED);
	mControlResizer.AddControl(IDC_STATIC_MEDIA_TIME, RSZF_RIGHT_FIXED);
	mControlResizer.AddControl(IDC_BUTTON_MEDIA_FULLSCREEN, RSZF_SIZE_FIXED|RSZF_BOTTOM_FIXED);
	HICON hIcon(::AfxGetApp()->LoadIcon(IDI_ICON_FULLSCREEN));
	((CButton*)GetDlgItem(IDC_BUTTON_MEDIA_FULLSCREEN))->SetIcon(hIcon);
	SetTransparent(150, DWF_TRANSPARENT_INSIDE);
	m_ToolTip.Create(this);
	int ids[] = {IDC_BUTTON_MEDIA_FULLSCREEN, IDC_BUTTON_MEDIA_PLAY_PAUSE};
	LPCTSTR tips[] = {_T("Toggle Fullscreen"), _T("Pause")};
	for (int i = 0; i < sizeof(ids)/sizeof(ids[0]); i++) {
		RECT cr;
		CWnd *pCtrl(GetDlgItem(ids[i]));
		pCtrl->GetClientRect(&cr);
		m_ToolTip.AddTool(pCtrl, tips[i], &cr, ids[i]);
	}
	m_ToolTip.Activate(TRUE);
	return bRet;
}
Exemplo n.º 28
0
ALERROR CLoginSession::OnInit (CString *retsError)

//	OnInit
//
//	Initialize

	{
	//	We're showing dialog boxes, so the previous session shows through.

	SetTransparent();

	//	See if any background tasks are running. If so, then we show the status
	//	dialog box and wait for tasks to complete.

	if (m_HI.RegisterOnAllBackgroundTasksComplete(this))
		{
		const CVisualPalette &VI = m_HI.GetVisuals();
		RECT rcRect;
		VI.GetWidescreenRect(m_HI.GetScreen(), &rcRect);

		//	Create a wait animation

		IAnimatron *pAni;
		VI.CreateWaitAnimation(NULL, ID_CTRL_WAIT, rcRect, &pAni);
		StartPerformance(pAni, ID_CTRL_WAIT, CReanimator::SPR_FLAG_DELETE_WHEN_DONE);

		return NOERROR;
		}
	
	//	Otherwise, we show the sign in dialog box

	ShowInitialDlg();

	//	Done

	return NOERROR;
	}
Exemplo n.º 29
0
bool OCPN_AlertDialog::Create( wxWindow *parent, wxWindowID id,
                                   const wxString& caption, const wxPoint& pos, const wxSize& size, long style )

{
    //    As a display optimization....
    //    if current color scheme is other than DAY,
    //    Then create the dialog ..WITHOUT.. borders and title bar.
    //    This way, any window decorations set by external themes, etc
    //    will not detract from night-vision
    
    long wstyle = wxDEFAULT_FRAME_STYLE;
    if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )
        && ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );
    
    wxSize size_min = size;
    size_min.IncTo( wxSize( 500, 600 ) );
    if( !wxDialog::Create( parent, id, caption, pos, size_min, wstyle ) ) return false;
    
    m_pparent = parent;
    
    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );
    
    return true;
}
void
FormWindow::Init(const FormDef& def)
{
	if (def.GetRect().w > 0 && def.GetRect().h > 0) {
		// if form size is specified in def, and it is 
		// smaller than the current screen size,
		// center the form on the display:

		Rect r = def.GetRect();

		if (r.w < screen->Width()) {
			r.x = (screen->Width()  - r.w) / 2;
		}
		else {
			r.x = 0;
			r.w = screen->Width();
		}

		if (r.h < screen->Height()) {
			r.y = (screen->Height() - r.h) / 2;
		}
		else {
			r.y = 0;
			r.h = screen->Height();
		}

		MoveTo(r);
	}

	SetMargins(def.GetMargins());
	SetTextInsets(def.GetTextInsets());
	SetCellInsets(def.GetCellInsets());
	SetCells(def.GetCells());
	SetFixedWidth(def.GetFixedWidth());
	SetFixedHeight(def.GetFixedHeight());

	UseLayout(def.GetLayout().x_mins,
	def.GetLayout().y_mins,
	def.GetLayout().x_weights,
	def.GetLayout().y_weights);

	if (def.GetTexture().length() > 0) {
		DataLoader* loader = DataLoader::GetLoader();
		loader->SetDataPath("Screens/");
		loader->LoadTexture(def.GetTexture(), texture);
		loader->SetDataPath("");
	}

	SetBackColor(def.GetBackColor());
	SetForeColor(def.GetForeColor());

	Font* f = FontMgr::Find(def.GetFont());
	if (f) SetFont(f);

	SetTransparent(def.GetTransparent());

	ListIter<CtrlDef> ctrl = def.GetControls();
	while (++ctrl) {
		switch (ctrl->GetType()) {
		case WIN_DEF_FORM:
		case WIN_DEF_LABEL:
		default:
			CreateDefLabel(*ctrl);
			break;

		case WIN_DEF_BUTTON:
			CreateDefButton(*ctrl);
			break;

		case WIN_DEF_COMBO:
			CreateDefCombo(*ctrl);
			break;

		case WIN_DEF_IMAGE:
			CreateDefImage(*ctrl);
			break;

		case WIN_DEF_EDIT:
			CreateDefEdit(*ctrl);
			break;

		case WIN_DEF_LIST:
			CreateDefList(*ctrl);
			break;

		case WIN_DEF_SLIDER:
			CreateDefSlider(*ctrl);
			break;

		case WIN_DEF_RICH:
			CreateDefRichText(*ctrl);
			break;
		}
	}

	RegisterControls();
	DoLayout();
	CalcGrid();
}