View previous topic :: View next topic |
Author |
Message |
Bojo
Joined: 22 Oct 2004 Posts: 23 Location: Denmark
|
Posted: Sun Oct 24, 2004 4:47 am Post subject: Windows XP look |
|
|
Hi
How come some controls has the XP look (f.inst. the scrollbars in TextBox), but others (f.inst Buttons and Checkboxes) doesn't?
Regards
Bojo |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Sun Oct 24, 2004 3:18 pm Post subject: |
|
|
When loading those controls from the NULL instance, they have the classic look; probably for compatibility reasons. The XP styles are loaded elsewhere, maybe shell32.
I'm not sure how I should handle this yet. |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
|
Back to top |
|
|
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Mon Oct 25, 2004 3:40 pm Post subject: |
|
|
Does the 'XP' look by default come with those blue shadowed menus ? And 'rollover' style buttons etc ? I remember reading something about this it needs a 'manifest' of some sort i think.
Charlie |
|
Back to top |
|
|
Bojo
Joined: 22 Oct 2004 Posts: 23 Location: Denmark
|
Posted: Mon Oct 25, 2004 3:44 pm Post subject: |
|
|
I've tried the manifest thing with some DFL examples, and everything looks ok except the standard button!
In XP the standard button gets an ugly border:
Left button is DFL, right button is from windows explorer. |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Wed Oct 27, 2004 5:52 am Post subject: |
|
|
Try:
Code: | import dfl.winapi;
SetWindowLongA(button.handle, GWL_STYLE, GetWindowLongA(button.handle, GWL_STYLE) | 0x00008000); |
It sets the style BS_FLAT. If that doesn't work, then I don't know. Should I install XP just for this? ;p |
|
Back to top |
|
|
Bojo
Joined: 22 Oct 2004 Posts: 23 Location: Denmark
|
Posted: Wed Oct 27, 2004 8:53 am Post subject: |
|
|
Vathix wrote: | Try:
Code: | import dfl.winapi;
SetWindowLongA(button.handle, GWL_STYLE, GetWindowLongA(button.handle, GWL_STYLE) | 0x00008000); |
It sets the style BS_FLAT. If that doesn't work, then I don't know. Should I install XP just for this? ;p |
Didn't help.
I've just noticed that the radiobutton also have a problem. The background is solid black, when using the XP-manifest.
The checkbox looks fine.
It seems that Visual Basic has the same problem:
http://groups.google.dk/groups?q=xp+manifest+black+background&hl=da&lr=&selm=1015509510.467705?40ernani.logica.co.uk&rnum=10 |
|
Back to top |
|
|
Bojo
Joined: 22 Oct 2004 Posts: 23 Location: Denmark
|
Posted: Sat Oct 30, 2004 1:11 pm Post subject: |
|
|
Just tried making some buttons and radiobuttons in D using only the API. Everything looks fine when applying the XP manifest. |
|
Back to top |
|
|
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Wed Nov 03, 2004 1:51 pm Post subject: |
|
|
Using only the win32 API ?
Can you paste the code and the linking / compiling options ? Maybe its something to do with the linker .
Also how do you use a manifest with DFL ?
Thanks!
Charlie |
|
Back to top |
|
|
Bojo
Joined: 22 Oct 2004 Posts: 23 Location: Denmark
|
Posted: Wed Nov 03, 2004 3:04 pm Post subject: |
|
|
qbert wrote: | Using only the win32 API ?
Can you paste the code and the linking / compiling options ? Maybe its something to do with the linker .
|
Well, I simply took the winsamp.d example from dmd's sample folder and changed one of the buttons into a radiobutton.
Code: |
// btnDontClick = CreateWindowA("BUTTON", "DON'T CLICK!", WS_CHILD | WS_VISIBLE,
// 110, 0, 100, 25, hWnd, cast(HMENU) IDC_BTNDONTCLICK, hInst, null);
btnDontClick = CreateWindowA("BUTTON", "DON'T CLICK!", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | BS_LEFT | BS_VCENTER, 110, 0, 100, 25, hWnd, cast(HMENU) IDC_BTNDONTCLICK, hInst, null);
|
qbert wrote: | Also how do you use a manifest with DFL ?
|
I just saved it as a file "Winsamp.exe.manifest"
Regards
Bo |
|
Back to top |
|
|
|