Exemplo n.º 1
0
void AuiManagerWrapper::ToXRC(wxString& text, XRC_TYPE type) const
{
    text << "<object class=\"wxAuiManager\">";
    text << "<style>" << StyleFlags("wxAUI_MGR_DEFAULT") << "</style>";
    text << "<sashsize>" << PropertyInt(PROP_AUI_SASH_SIZE) << "</sashsize>";
    text << "<pane-border-size>" << PropertyInt(PROP_AUI_PANE_BORDER_SIZE) << "</pane-border-size>";
    text << "<sash-colour>" << wxCrafter::GetColourForXRC(PropertyString(PROP_AUI_SASH_COLOUR)) << "</sash-colour>";
    text << "<caption-colour>" << wxCrafter::GetColourForXRC(PropertyString(PROP_AUI_CAPTION_COLOUR));
    text << "</caption-colour>";
    text << "<caption-colour-gradient>" << wxCrafter::GetColourForXRC(PropertyString(PROP_AUI_CAPTION_COLOUR_GRADIENT));
    text << "</caption-colour-gradient>";
    text << "<inactive-caption-colour>" << wxCrafter::GetColourForXRC(PropertyString(PROP_AUI_INACTIVE_CAPTION_COLOUR));
    text << "</inactive-caption-colour>";
    text << "<inactive-caption-colour-gradient>";
    text << wxCrafter::GetColourForXRC(PropertyString(PROP_AUI_INACTIVE_CAPTION_COLOUR_GRADIENT));
    text << "</inactive-caption-colour-gradient>";
    text << "<caption-text-colour>" << wxCrafter::GetColourForXRC(PropertyString(PROP_AUI_ACTIVE_CAPTION_TEXT_COLOUR));
    text << "</caption-text-colour>";
    text << "<inactive-caption-text-colour>";
    text << wxCrafter::GetColourForXRC(PropertyString(PROP_AUI_ACTIVE_CAPTION_TEXT_COLOUR));
    text << "</inactive-caption-text-colour>";
    text << "<gradient-type>" << PropertyString(PROP_AUI_GRADIENT_TYPE) << "</gradient-type>";

    ChildrenXRC(text, type);
    text << XRCSuffix();
}
Exemplo n.º 2
0
wxString AuiManagerWrapper::CppCtorCode() const
{
    wxString cppCode;
    cppCode << GetName() << " = new wxAuiManager;\n";

    if(GetParent()->IsTopWindow()) {
        cppCode << GetName() << "->SetManagedWindow( this );\n";
    } else {
        cppCode << GetName() << "->SetManagedWindow( " << GetParent()->GetName() << " );\n";
    }
    cppCode << GetName() << "->SetFlags( " << StyleFlags("0") << ");\n";
    if(PropertyInt(PROP_AUI_SASH_SIZE) != -1)
        cppCode << GetName() << "->GetArtProvider()->SetMetric( wxAUI_DOCKART_SASH_SIZE, "
                << PropertyInt(PROP_AUI_SASH_SIZE) << ");\n";

    if(PropertyInt(PROP_AUI_PANE_BORDER_SIZE) != -1)
        cppCode << GetName() << "->GetArtProvider()->SetMetric( wxAUI_DOCKART_PANE_BORDER_SIZE, "
                << PropertyInt(PROP_AUI_PANE_BORDER_SIZE) << ");\n";

    wxString col;

    col = wxCrafter::ColourToCpp(PropertyString(PROP_AUI_SASH_COLOUR));
    if(!col.IsEmpty())
        cppCode << GetName() << "->GetArtProvider()->SetColor( wxAUI_DOCKART_SASH_COLOUR, " << col << ");\n";

    col = wxCrafter::ColourToCpp(PropertyString(PROP_AUI_CAPTION_COLOUR));
    if(!col.IsEmpty())
        cppCode << GetName() << "->GetArtProvider()->SetColor( wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR, " << col << ");\n";

    col = wxCrafter::ColourToCpp(PropertyString(PROP_AUI_CAPTION_COLOUR_GRADIENT));
    if(!col.IsEmpty())
        cppCode << GetName() << "->GetArtProvider()->SetColor( wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR, " << col
                << ");\n";

    col = wxCrafter::ColourToCpp(PropertyString(PROP_AUI_INACTIVE_CAPTION_COLOUR));
    if(!col.IsEmpty())
        cppCode << GetName() << "->GetArtProvider()->SetColor( wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR, " << col
                << ");\n";

    col = wxCrafter::ColourToCpp(PropertyString(PROP_AUI_INACTIVE_CAPTION_COLOUR_GRADIENT));
    if(!col.IsEmpty())
        cppCode << GetName() << "->GetArtProvider()->SetColor( wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR, " << col
                << ");\n";

    col = wxCrafter::ColourToCpp(PropertyString(PROP_AUI_ACTIVE_CAPTION_TEXT_COLOUR));
    if(!col.IsEmpty())
        cppCode << GetName() << "->GetArtProvider()->SetColor( wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR, " << col
                << ");\n";

    col = wxCrafter::ColourToCpp(PropertyString(PROP_AUI_INACTIVE_CAPTION_TEXT_COLOUR));
    if(!col.IsEmpty())
        cppCode << GetName() << "->GetArtProvider()->SetColor( wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR, " << col
                << ");\n";
    cppCode << GetName() << "->GetArtProvider()->SetMetric(wxAUI_DOCKART_GRADIENT_TYPE, "
            << PropertyString(PROP_AUI_GRADIENT_TYPE) << ");\n";

    return cppCode;
}
Exemplo n.º 3
0
wxString PanelWrapper::CppCtorCode() const
{
    // m_panel4 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxString code;

    code << GetName() << wxT(" = new ") << GetRealClassName() << "(" << GetWindowParent() << wxT(", ") << WindowID()
         << wxT(", ") << wxT("wxDefaultPosition") << wxT(", ") << SizeAsString() << wxT(", ")
         << StyleFlags("wxTAB_TRAVERSAL") << ");\n";
    code << CPPCommonAttributes();
    return code;
}
Exemplo n.º 4
0
wxString RibbonPanelWrapper::CppCtorCode() const
{
    wxString cppCode;
    wxcCodeGeneratorHelper::Get().AddBitmap(PropertyFile(PROP_BITMAP_PATH));

    cppCode << GetName() << " = new " << GetRealClassName() << "(" << GetWindowParent() << ", " << GetId() << ", "
            << Label() << ", " << wxcCodeGeneratorHelper::Get().BitmapCode(PropertyFile(PROP_BITMAP_PATH)) << ", "
            << "wxDefaultPosition, " << SizeAsString() << ", " << StyleFlags("wxRIBBON_PANEL_DEFAULT_STYLE") << ");\n";
    cppCode << CPPCommonAttributes();
    return cppCode;
}
Exemplo n.º 5
0
wxString StatusBarWrapper::CppCtorCode() const
{
    // wxStatusBar(wxWindow* parent, wxWindowID id = wxID_ANY, long style = wxST_SIZEGRIP, const wxString& name =
    // "statusBar")
    wxString code;
    code << GetName() << wxT(" = new ") << GetRealClassName() << wxT("(") << GetWindowParent() << wxT(", ")
         << WindowID() << wxT(", ") << StyleFlags(wxT("wxST_SIZEGRIP")) << wxT(");\n");
    code << GetName() << wxT("->SetFieldsCount(") << wxCrafter::ToNumber(PropertyString(PROP_FIELD_COUNT), 1)
         << wxT(");\n");
    code << GetWindowParent() << wxT("->SetStatusBar(") << GetName() << wxT(");\n");
    return code;
}
Exemplo n.º 6
0
wxString RadioButtonWrapper::CppCtorCode() const
{
    // m_radioBtn3 = new wxRadioButton( m_panel11, wxID_ANY, wxT("RadioBtn"), wxDefaultPosition, wxDefaultSize,
    // wxRB_USE_CHECKBOX ); m_radioBtn3->SetValue( true );

    wxString code;
    code << GetName() << wxT(" = new ") << GetRealClassName() << "(" << GetWindowParent() << wxT(", ") << WindowID()
         << wxT(", ") << Label() << wxT(", ") << wxT("wxDefaultPosition, ") << SizeAsString() << wxT(", ")
         << StyleFlags(wxT("0")) << wxT(");\n");
    code << CPPCommonAttributes();
    code << GetName() << wxT("->SetValue(") << PropertyString(PROP_VALUE) << wxT(");\n");
    return code;
}
Exemplo n.º 7
0
wxString ColourPickerWrapper::CppCtorCode() const
{
    wxString code;
    wxString color = wxCrafter::ColourToCpp(PropertyString(PROP_VALUE));
    if(color.IsEmpty()) { color << wxT("*wxBLACK"); }

    code << GetName() << wxT(" = new ") << GetRealClassName() << wxT("(") << GetWindowParent() << wxT(", ")
         << WindowID() << wxT(", ") << color << wxT(", ") << wxT("wxDefaultPosition, ") << SizeAsString() << wxT(", ")
         << StyleFlags(wxT("wxCLRP_DEFAULT_STYLE")) << wxT(");\n");

    code << CPPCommonAttributes();
    return code;
}
Exemplo n.º 8
0
//-------------------------------------------------------------------------
//	calcs the window's overall size to accomadate the client size
//-------------------------------------------------------------------------
void GWinControl::ResizeClientArea(int2 ClientSize)
{
	RECT ClientRect;
	ClientRect.top		= 0;
	ClientRect.left		= 0;
	ClientRect.bottom	= ClientSize.y;
	ClientRect.right	= ClientSize.x;

	if ( !AdjustWindowRectEx( &ClientRect, StyleFlags(), HasMenu(), StyleExFlags() ) )
	{
		GDebug::CheckWin32Error();
		return;
	}

	//	set new window size
	Resize( int2( ClientRect.right-ClientRect.left, ClientRect.bottom-ClientRect.top ) );
}
Exemplo n.º 9
0
Bool GWinControl::Init(GWinControl* pOwner, u32 Flags, u32 ControlID, char* WindowName)
{
	//	check we havent already created a contorl
	if ( m_Hwnd != NULL )
	{
		GDebug_Break("Control already created\n");
		return FALSE;
	}
	
	//	create control
	Flags |= AdditionalStyleFlags();
	m_StyleFlags	= Flags;

//	HMENU hMenu		= (HMENU)ControlID;
	HMENU hMenu		= (HMENU)NULL;
	HINSTANCE hInstance = GApp::g_HInstance;
	HWND OwnerHwnd	= pOwner ? pOwner->m_Hwnd : m_OwnerHwnd;

	//	reset handle
	m_Hwnd = NULL;

	m_ControlID = ControlID;
	m_pOwnerControl = pOwner;

	//	get resulting hwnd, m_Hwnd is set from the WM_CREATE callback
	HWND ResultHwnd = CreateWindowEx( StyleExFlags(), ClassName(), WindowName, StyleFlags(), m_ClientPos.x, m_ClientPos.y, m_ClientSize.x, m_ClientSize.y, OwnerHwnd, hMenu, hInstance, (void*)this );

	//	if control doesnt get a WM_CREATE (if its a standard windows control) call it
	if ( ResultHwnd != NULL && m_Hwnd == NULL )
	{
		OnWindowCreate( this, ResultHwnd );
	}

	//	failed
	if ( m_Hwnd == NULL || ResultHwnd == NULL || m_Hwnd != ResultHwnd )
	{
		GDebug::CheckWin32Error();
		return FALSE;
	}

	//	control has been created
	OnCreate();

	return TRUE;
}
Exemplo n.º 10
0
void GWinControl::SetNewStyleFlags(u32 Flags)
{
	m_StyleFlags = Flags;

	if ( !SetWindowLong( m_Hwnd, GWL_STYLE, StyleFlags() ) )
		GDebug::CheckWin32Error();

	if ( !SetWindowLong( m_Hwnd, GWL_EXSTYLE, StyleExFlags() ) )
		GDebug::CheckWin32Error();

	HWND WindowOrder = HWND_NOTOPMOST;
	if ( StyleExFlags() & GWinControlFlags::AlwaysOnTop )
		WindowOrder = HWND_TOPMOST;

	//	update/refresh window
	if ( !SetWindowPos( m_Hwnd, WindowOrder, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE ) )
		GDebug::CheckWin32Error();

}
Exemplo n.º 11
0
wxString GLCanvasWrapper::CppCtorCode() const
{
    wxString cppCode;
    wxString attrList;
    wxArrayString validAttrsName, validAttrsValue;
    // get the number of attributes provided
    int bufferSize = 0;
    for(size_t i = 0; i < m_attrs.GetCount(); ++i) {
        wxString v = PropertyString(m_attrs.Item(i));
        if(!v.Trim().Trim(false).IsEmpty()) {
            bufferSize += 2; // one for the property and one for its value
            validAttrsName.Add(m_attrs.Item(i));
            validAttrsValue.Add(v);
        }
    }

    wxString AttrName;
    AttrName << GetName() << "Attr";
    if(bufferSize) {
        bufferSize++; // terminator
        attrList << "int *" << AttrName << " = new int[ " << bufferSize << " ];\n";
    } else {
        attrList << "int *" << AttrName << " = NULL;\n";
    }

    int idx = 0;
    for(size_t i = 0; i < validAttrsName.GetCount(); ++i) {
        attrList << AttrName << "[" << idx++ << "] = " << validAttrsName.Item(i) << ";\n";
        attrList << AttrName << "[" << idx++ << "] = " << validAttrsValue.Item(i) << ";\n";
    }

    if(validAttrsName.GetCount()) { attrList << AttrName << "[" << idx << "] = 0;\n"; }

    if(!attrList.IsEmpty()) { cppCode << attrList; }

    cppCode << GetName() << " = new " << GetRealClassName() << "(" << GetWindowParent() << ", " << GetId() << ", "
            << AttrName << ", "
            << "wxDefaultPosition, " << SizeAsString() << ", " << StyleFlags("0") << ");\n";
    cppCode << CPPCommonAttributes();
    cppCode << "wxDELETEA( " << AttrName << " );\n";
    return cppCode;
}
Exemplo n.º 12
0
wxString HyperLinkCtrlWrapper::CppCtorCode() const
{
    wxString code;
    code << GetName() << wxT(" = new ") << GetRealClassName() << wxT("(") << GetWindowParent() << wxT(", ")
         << WindowID() << wxT(", ") << wxCrafter::UNDERSCORE(PropertyString(PROP_LABEL)) << wxT(", ")
         << wxCrafter::WXT(PropertyString(PROP_URL)) << wxT(", ") << wxT("wxDefaultPosition, ") << SizeAsString()
         << wxT(", ") << StyleFlags(wxT("wxHL_DEFAULT_STYLE")) << wxT(");\n");

    code << CPPCommonAttributes();
    wxString color;
    color = wxCrafter::ColourToCpp(PropertyString(PROP_NORMAL_COLOR));
    if(color.IsEmpty() == false) { code << GetName() << wxT("->SetNormalColour(") << color << wxT(");\n"); }

    color = wxCrafter::ColourToCpp(PropertyString(PROP_HOVER_COLOR));
    if(color.IsEmpty() == false) { code << GetName() << wxT("->SetHoverColour(") << color << wxT(");\n"); }

    color = wxCrafter::ColourToCpp(PropertyString(PROP_VISITED_COLOR));
    if(color.IsEmpty() == false) { code << GetName() << wxT("->SetVisitedColour(") << color << wxT(");\n"); }
    return code;
}
Exemplo n.º 13
0
wxString GenericDirCtrlWrapper::CppCtorCode() const
{
    // wxGenericDirCtrl(wxWindow* parent, const wxWindowID id = -1, const wxString& dir = wxDirDialogDefaultFolderStr,
    // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style =
    // wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, const wxString& filter = wxEmptyString, int defaultFilter = 0, const
    // wxString& name = wxTreeCtrlNameStr)
    wxString code;
    code << GetName() << wxT(" = new ") << GetRealClassName() << wxT("(") << GetWindowParent() << wxT(", ")
         << WindowID() << wxT(", ") << wxCrafter::WXT(PropertyString(PROP_DEFAULT_FOLDER)) << wxT(", ")
         << wxT("wxDefaultPosition, ") << SizeAsString() << wxT(", ")
         << StyleFlags(wxT("wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER")) << wxT(");\n");

    code << CPPCommonAttributes();

    // Set the default path
    wxString path = PropertyString(PROP_DEFAULT_FOLDER);

    path.Trim().Trim(false);
    if(path.IsEmpty() == false) {
        code << GetName() << wxT("->SetDefaultPath(") << wxCrafter::WXT(path) << wxT(");\n");
    }

    // Set the filter string
    wxString filter = PropertyString(PROP_FILTER);
    filter.Trim().Trim(false);

    if(filter.IsEmpty() == false) { code << GetName() << wxT("->SetFilter(") << wxCrafter::WXT(filter) << wxT(");\n"); }

    // Set the filter index
    wxString filterIndex = PropertyString(PROP_DEFAULT_FILTER);
    filterIndex.Trim().Trim(false);

    int index = wxCrafter::ToNumber(filterIndex, -1);
    if(-1 != index) { code << GetName() << wxT("->SetFilterIndex(") << index << wxT(");\n"); }

    // Show hidden files?
    wxString show = PropertyBool(PROP_SHOW_HIDDEN);
    code << GetName() << wxT("->ShowHidden(") << show << wxT(");\n");

    return code;
}
Exemplo n.º 14
0
wxString ChoiceWrapper::CppCtorCode() const
{
    wxString code;
    wxArrayString options = wxCrafter::Split(PropertyString(PROP_OPTIONS), wxT(";"));

    code << wxT("wxArrayString ") << GetName() << wxT("Arr;\n");
    for(size_t i = 0; i < options.GetCount(); i++) {
        code << GetName() << wxT("Arr.Add(wxT(\"") << options.Item(i) << wxT("\"));\n");
    }

    code << GetName() << wxT(" = new ") << GetRealClassName() << "(" << GetWindowParent() << wxT(", ") << WindowID()
         << wxT(", ") << wxT("wxDefaultPosition, ") << SizeAsString() << wxT(", ") << GetName() << wxT("Arr")
         << wxT(", ") << StyleFlags(wxT("0")) << wxT(");\n");

    code << CPPCommonAttributes();
    long sel = wxCrafter::ToNumber(PropertyString(PROP_SELECTION), -1);
    if(sel != -1 && sel < (long)options.GetCount()) {
        code << GetName() << wxT("->SetSelection(") << sel << wxT(");\n");
    }
    return code;
}
Exemplo n.º 15
0
wxString AnimationCtrlWrapper::CppCtorCode() const
{
    wxcCodeGeneratorHelper::Get().AddBitmap(PropertyFile(PROP_DISABLED_BITMAP_PATH));

    wxString code;
    // wxAnimationCtrl (wxWindow *parent, wxWindowID id, const wxAnimation &anim=wxNullAnimation, const wxPoint
    // &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxAC_DEFAULT_STYLE, const wxString
    // &name=wxAnimationCtrlNameStr)
    code << GetName() << wxT(" = new ") << GetRealClassName() << "(" << GetWindowParent() << wxT(", ") << WindowID()
         << wxT(", wxNullAnimation, wxDefaultPosition, ") << SizeAsString() << wxT(", ")
         << StyleFlags(wxT("wxAC_DEFAULT_STYLE")) << wxT(");\n");

    // Load the image file
    if(PropertyBool(PROP_ANIM_AUTO_PLAY) == "true") {
        code << "if( wxFileName::Exists(" << wxCrafter::WXT(PropertyFile(PROP_BITMAP_PATH)) << ") && " << GetName()
             << "->LoadFile(" << wxCrafter::WXT(PropertyFile(PROP_BITMAP_PATH)) << "))" << GetName() << "->Play();\n";
    }
    code << CPPCommonAttributes();
    code << GetName() << "->SetInactiveBitmap("
         << wxcCodeGeneratorHelper::Get().BitmapCode(PropertyFile(PROP_DISABLED_BITMAP_PATH)) << ");\n";
    return code;
}
Exemplo n.º 16
0
wxString BitmapComboxWrapper::CppCtorCode() const
{
    wxArrayString labels, bitmaps;
    wxString options = PropertyString(PROP_CB_CHOICES);
    BmpTextVec_t arr = BmpTextSelectorDlg::FromString(options);
    for(size_t i = 0; i < arr.size(); ++i) {
        wxcCodeGeneratorHelper::Get().AddBitmap(arr.at(i).first);
        bitmaps.Add(wxcCodeGeneratorHelper::Get().BitmapCode(arr.at(i).first));
        labels.Add(arr.at(i).second);
    }
    wxString code;
    code << GetName() << wxT(" = new ") << GetRealClassName() << "(" << GetWindowParent() << wxT(", ") << WindowID()
         << wxT(", wxEmptyString") << wxT(", wxDefaultPosition, ") << SizeAsString() << wxT(", wxArrayString(), ")
         << StyleFlags(wxT("0")) << wxT(");\n");

    // Append the items
    for(size_t i = 0; i < labels.GetCount(); ++i) {
        code << GetName() << "->Append(" << wxCrafter::UNDERSCORE(labels.Item(i)) << ", " << bitmaps.Item(i) << ");\n";
    }
    int sel = PropertyInt(PROP_SELECTION);
    if(sel != wxNOT_FOUND && sel < (int)labels.GetCount()) { code << GetName() << "->SetSelection(" << sel << ");\n"; }
    return code;
}
Exemplo n.º 17
0
wxString ListCtrlWrapper::CppCtorCode() const
{
    // wxListCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size =
    // wxDefaultSize,
    //            long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name =
    //            wxListCtrlNameStr)
    wxString code;
    code << GetName() << wxT(" = new ") << GetRealClassName() << "(" << GetWindowParent() << wxT(", ") << WindowID()
         << wxT(", ") << wxT("wxDefaultPosition, ") << SizeAsString() << wxT(", ") << StyleFlags(wxT("0"))
         << wxT(");\n");
    code << CPPCommonAttributes();
    return code;
}
Exemplo n.º 18
0
//-------------------------------------------------------------------------
//	update window's scrollbar info if applicable
//-------------------------------------------------------------------------
void GWinControl::UpdateScrollBars()
{
	//	only needed if window is setup
	if ( !Hwnd() )
		return;

	//	
	SCROLLINFO ScrollInfo;
	ScrollInfo.cbSize = sizeof(SCROLLINFO);

	//	update vert scroll bar
	if ( StyleFlags() & GWinControlFlags::VertScroll )
	{
		int Min = 0;
		int Max = 0;
		int Jump = 0;
		int Pos = 0;
		Bool Enable = GetVertScrollProperties( Min, Max, Jump, Pos );

		ScrollInfo.fMask  = SIF_RANGE | SIF_PAGE | SIF_POS; 
		if ( Enable )
		{
			ScrollInfo.nMin		= Min;
			ScrollInfo.nMax		= Max;
			ScrollInfo.nPage	= Jump;
			ScrollInfo.nPos		= Pos;
			ScrollInfo.fMask |= SIF_DISABLENOSCROLL;	//	disable if invalid/useless properties (eg. min==max)
		}
		else
		{
			//	remove scroll bar by invalidating properies and NOT setting SIF_DISABLENOSCROLL flag
			ScrollInfo.nMin		= 0;
			ScrollInfo.nMax		= 0;
			ScrollInfo.nPage	= 0;
			ScrollInfo.nPos		= 0;
			ScrollInfo.fMask &= ~SIF_DISABLENOSCROLL;
		}

		SetScrollInfo( Hwnd(), SB_VERT, &ScrollInfo, TRUE );
	}

	//	update horz scroll bar
	if ( StyleFlags() & GWinControlFlags::HorzScroll )
	{
		int Min = 0;
		int Max = 0;
		int Jump = 0;
		int Pos = 0;
		Bool Enable = GetHorzScrollProperties( Min, Max, Jump, Pos );

		ScrollInfo.fMask  = SIF_RANGE | SIF_PAGE | SIF_POS; 
		if ( Enable )
		{
			ScrollInfo.nMin		= Min;
			ScrollInfo.nMax		= Max;
			ScrollInfo.nPage	= Jump;
			ScrollInfo.nPos		= Pos;
			ScrollInfo.fMask |= SIF_DISABLENOSCROLL;	//	disable if invalid/useless properties (eg. min==max)
		}
		else
		{
			//	remove scroll bar by invalidating properies and NOT setting SIF_DISABLENOSCROLL flag
			ScrollInfo.nMin		= 0;
			ScrollInfo.nMax		= 0;
			ScrollInfo.nPage	= 0;
			ScrollInfo.nPos		= 0;
			ScrollInfo.fMask &= ~SIF_DISABLENOSCROLL;
		}

		SetScrollInfo( Hwnd(), SB_HORZ, &ScrollInfo, TRUE );
	}
}