Quantcast
Channel: wxWidgets: Ticket Query
Viewing all articles
Browse latest Browse all 66

#10378: Transparent wxSlider issue

$
0
0

Dear Sir/Madam,

I have tried wxMS_Developer forum, search google, tried many different approach, and I still can not figure out how to get wxSlider to show properly on top of an image background on windows PC. wxSlider works as expected in Mac OS X systems.

I will attach 2 pictures, one is captured from wxMac-2.8.9 which works fine, and one is captured from wxMSW-2.8.9 which does not work.

If you compare the 2 files, you will see that on wxMac-2.8.9.tiff:

1. There is no "grey" border surrounding the horizontal line where the slider is.

2. The numbers (200, 600, and 1000) are not surrounded by the "grey" border.

3. The number (1000) is not cut off like wxMSW does. wxMSW only show "000".

I use the same code in both wxMSW and wxMac.

For my frame's background image, here is the code I use:

void MyFrame::OnPaint(wxPaintEvent & e) {

int width, height; this->GetClientSize(&width, &height); wxPaintDC dc(this); wxBitmap scaledBitMap = wxBitmap(mMainScreenImage.Scale(width, height, wxIMAGE_QUALITY_NORMAL)); dc.DrawBitmap(scaledBitMap,0,0,true);

}

BEGIN_EVENT_TABLE(MyFrame, wxFrame)

EVT_PAINT(MyFrame::OnPaint)

END_EVENT_TABLE()

I use xrc file to describe the wxSlider as follow:

<object class="wxSlider" name="wxID_SLIDER_1"> <style>wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS|wxALWAYS_SHOW_SB</style> <value>600</value> <min>200</min> <max>1000</max> </object>

Here is how I load the xrc file:

if (!wxXmlResource::Get()->Load(wxT("xrc/Slider.xrc")))

return false;

I believe the xrc file works properly because the button works properly.

Please let me know if you need any more information.


Viewing all articles
Browse latest Browse all 66

Trending Articles