Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » Chameleon background/paper skinning for TopWindow
Chameleon background/paper skinning for TopWindow [message #41940] Fri, 07 February 2014 21:33 Go to previous message
galious is currently offline  galious
Messages: 28
Registered: March 2008
Promising Member
Hi,

I'm using Windows 8. In Windows 8 all U++ windows are by default shown with a black window background. Normally this wouldn't be a problem since I already set the window background in all of my. However also the dialog windows (e.g. PromptOK(...)) do show up with a black window background.

Since I do not like this, I decided to patch the TopWindow to be able to set a global background skin. I've made the following changes:

TopWindow.cpp
void TopWindow::Paint(Draw& w)
{
	background.Paint(w, Rect(GetSize()), SColorText, SColorShadow);
	Size sz = GetSize();
	ChPaint(w, sz, st->paper);
}

CH_STYLE(TopWindow, TopStyle, StyleDefault)
{
	paper = Null;
}

TopWindow& TopWindow::SetStyle(const TopStyle& s)
{
	st = &s;
	RefreshLayout();
	RefreshFrame();
	return *this;
}

TopWindow::TopWindow()
{
	GuiLock __;
	TransparentBackPaint();
	background = PaintRect(Single<DialogBackground>(), Null);
	center = 1;
	minsize = Size(80, 20);
	GuiPlatformConstruct();
	maximizebox = minimizebox = sizeable = tool = noclosebox = false;
	state = OVERLAPPED;
	WhenClose = THISBACK(Close);
	overlapped.Clear();
	dokeys = true;
	fullscreen = frameless = urgent = false;
	SetStyle(StyleDefault());
}


and in TopWindow.h
public:
	struct TopStyle : ChStyle<TopStyle> {
		Color paper;
	};

protected:
	const TopStyle *st;

public:
	static const TopStyle& StyleDefault();
	TopWindow&  SetStyle(const TopStyle& s);


This code is backwards compatible (as in that it doesn't have any new styling and just shows the old behaviour). Any chance to have this included in trunk?

Best regards,
--Martin
 
Read Message
Read Message
Read Message
Previous Topic: TrayIcon does not work correctly with GTK backend.
Next Topic: ok and cancel button reversed on Linux
Goto Forum:
  


Current Time: Fri Apr 26 06:39:16 CEST 2024

Total time taken to generate the page: 0.03406 seconds