예제 #1
0
파일: Gauge.cpp 프로젝트: sirdel/buildrt
Gauge::Gauge(XMLNode gaugeNode) : RenderObject()
{
    m_Font = globals->m_FontManager->LoadDefaultFont();

    double x, y; // temp variables

    double scale = globals->m_PrefManager->GetPrefD("DefaultGaugeScale");
    double zoom = globals->m_PrefManager->GetPrefD("Zoom");

    // Set the scale
    if (gaugeNode.HasChild("Scale"))
    {
        gaugeNode.GetChild("Scale").GetTextAsCoord(x, y);
        SetScale(x * zoom * scale, y * zoom * scale);
    }
    else
    {
        SetScale(zoom * scale, zoom * scale);
    }

    // Set the position
    if (gaugeNode.HasChild("Position"))
    {
        gaugeNode.GetChild("Position").GetTextAsCoord(x, y);
        SetPosition(x * zoom, y * zoom);
    }
    else
    {
        SetPosition(0.0, 0.0);
    }

    // Set the size
    if (gaugeNode.HasChild("Size"))
    {
        gaugeNode.GetChild("Size").GetTextAsCoord(x, y);
        SetSize(x, y);
    }
    else
    {
        SetSize(0.0, 0.0);
    }

    // Set the opaque
    if (gaugeNode.HasChild("Opaque")) {
        SetOpaque(gaugeNode.GetChild("Opaque").GetTextAsBool());
    }
    else
    {
        SetOpaque(true);
    }
}
예제 #2
0
	void StyledCheckBox::Init() {
		SetRenderer(std::shared_ptr<DefaultCheckBoxRenderer>(new DefaultCheckBoxRenderer()));

		SetMinSize(wxSize(DEFAULT_MIN_WIDTH, 14));
		SetOpaque(false);
		pimpl->checked = false;
	}
예제 #3
0
void ShowPopup(HWND hwnd, HWND target_hwnd)
{
    // リソースからメニューを取得
    const auto hMenu    = ::LoadMenu(g_hInst, MAKEINTRESOURCE(100));
    const auto hSubMenu = ::GetSubMenu(hMenu, 0);

    // チェックマークを付ける
    CheckTopMost (target_hwnd, hSubMenu);
    CheckOpaque  (target_hwnd, ::GetSubMenu(hSubMenu, 2));
    CheckPriority(target_hwnd, ::GetSubMenu(hSubMenu, 3));

    // Article ID: Q135788
    // ポップアップメニューから処理を戻すために必要
    ::SetForegroundWindow(hwnd);

    // ポップアップメニューを表示
    POINT pt;
    ::GetCursorPos(&pt);

    const auto CmdID = ::TrackPopupMenu
    (
        hSubMenu, TPM_LEFTALIGN | TPM_NONOTIFY | TPM_RETURNCMD,
        pt.x, pt.y, 0, hwnd, nullptr
    );
    //WriteLog(elDebug, TEXT("%s: CmdId = %d"), PLUGIN_NAME, CmdID);

    // 表示したメニューを破棄
    ::DestroyMenu(hMenu);

    // Article ID: Q135788
    // ポップアップメニューから処理を戻すために必要
    ::PostMessage(hwnd, WM_NULL, 0, 0);

    // コマンドを実行
    if ( CmdID == 40000 )
    {
        ToggleTopMost(target_hwnd);
    }
    else if ( CmdID == 40001 )
    {
        OpenAppFolder(target_hwnd);
    }
    else if ( 40002 <= CmdID && CmdID <= 40005 )
    {
        ExecutePluginCommand(TEXT(":system"), CmdID - 40002);
    }
    else if ( CmdID == 40006 )
    {
        settings->load();
    }
    else if ( 41000 < CmdID && CmdID < 42000 )
    {
        SetOpaque(target_hwnd, BYTE(255 * (CmdID - 41000) / 100));
    }
    else if ( 42000 < CmdID && CmdID < 43000 )
    {
        SetPriority(target_hwnd, priority_sheet[CmdID - 42001]);
    }
}
예제 #4
0
void CDeflateCompressor::InitDecompression(CZipFileHeader* pFile, CZipCryptograph* pCryptograph)
{
	CBaseLibCompressor::InitDecompression(pFile, pCryptograph);
	if (m_pFile->m_uMethod == methodDeflate)
	{
		SetOpaque(&m_stream.opaque, &m_options);
		CheckForError(zarch_inflateInit2_(&m_stream, -MAX_WBITS, ZLIB_VERSION, sizeof(zarch_z_stream)));
	}
	m_stream.total_out = 0;
	m_stream.avail_in = 0;
}
예제 #5
0
void CDeflateCompressor::InitCompression(int iLevel, CZipFileHeader* pFile, CZipCryptograph* pCryptograph)
{
	CZipCompressor::InitCompression(iLevel, pFile, pCryptograph);

	m_stream.avail_in = (zarch_uInt)0;
	m_stream.avail_out = (zarch_uInt)m_pBuffer.GetSize();
	m_stream.next_out = (zarch_Bytef*)(char*)m_pBuffer;
	m_stream.total_in = 0;
	m_stream.total_out = 0;
	
	if (pFile->m_uMethod == methodDeflate)
	{
		SetOpaque(&m_stream.opaque, &m_options);
		
		int err = zarch_deflateInit2_(&m_stream, iLevel,
			Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, ZLIB_VERSION, sizeof(zarch_z_stream));
		
		CheckForError(err);
	}	
}
예제 #6
0
CubeTileMesh::CubeTileMesh(CUBE_FACES faces, const RectF *textureAtlasTileBoundaries, MESH_SIDES opaqueSides, TILE_LIGHT_VALUE lightValue, bool alpha, float translucency, const Color &color)
{
	m_faces = faces;

	SetOpaque(opaqueSides);
	SetAlpha(alpha);
	SetColor(color);
	SetTranslucency(translucency);
	SetLight(lightValue);

	m_topFaceVertexOffset = 0;
	m_bottomFaceVertexOffset = 0;
	m_frontFaceVertexOffset = 0;
	m_backFaceVertexOffset = 0;
	m_leftFaceVertexOffset = 0;
	m_rightFaceVertexOffset = 0;

	uint numVertices = 0;

	if (HasFace(SIDE_TOP))
	{
		m_topFaceVertexOffset = numVertices;
		numVertices += CUBE_VERTICES_PER_FACE;
	}
	if (HasFace(SIDE_BOTTOM))
	{
		m_bottomFaceVertexOffset = numVertices;
		numVertices += CUBE_VERTICES_PER_FACE;
	}
	if (HasFace(SIDE_FRONT))
	{
		m_frontFaceVertexOffset = numVertices;
		numVertices += CUBE_VERTICES_PER_FACE;
	}
	if (HasFace(SIDE_BACK))
	{
		m_backFaceVertexOffset = numVertices;
		numVertices += CUBE_VERTICES_PER_FACE;
	}
	if (HasFace(SIDE_LEFT))
	{
		m_leftFaceVertexOffset = numVertices;
		numVertices += CUBE_VERTICES_PER_FACE;
	}
	if (HasFace(SIDE_RIGHT))
	{
		m_rightFaceVertexOffset = numVertices;
		numVertices += CUBE_VERTICES_PER_FACE;
	}
	
	VERTEX_ATTRIBS attribs[] = {
		VERTEX_POS_3D,
		VERTEX_NORMAL,
		VERTEX_COLOR,
		VERTEX_TEXCOORD
	};

	m_vertices = new VertexBuffer();
	ASSERT(m_vertices != NULL);
	m_vertices->Initialize(attribs, 4, numVertices, BUFFEROBJECT_USAGE_STATIC);

	SetupFaceVertices(textureAtlasTileBoundaries);
	SetupCollisionVertices();
}