Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Mon, 14 Jul 2008 23:43:33 -0700,    group: microsoft.public.win32.programmer.ui        back       


Question for you "custom" GUI programmers out there   
For those of you who write custom GUIs (custom controls, fancy interfaces, 
etc), do you find that your code is filled with lots of "magic" numbers and 
special cases for the various OSes and animation modes, etc.

I do all the custom UI work for my company, but I find that my code is now 
filled with a lot of special cases for (in matrix form lol):

OS: NT4, Win95/98, NT5, XP, Win2k3, Vista
Mode: Themed / Non-Themed / Aero
Animation Flags: No anim, "fade" animation, "slide" animation

Seems like I'm often doing a lot of special handling for 6 x 3 x 3 cases. 
Ok, I don't need to do special code for all those cases all the time, but it 
seems like for the "wacky" stuff I do, I often need to add +1 or 
subtract -7, etc. based on that stuff.

The special cases are to get the pixels lined up correctly... for example 
with owner draw menus in fade mode, I inexplicably need to add +1 to get the 
stuff aligned. etc. for the metrics which have no clean way to obtain them.

And for my recent project of custom painting tooltips... oh boy, I almost 
had to special case entire chunks of code to get it to work correctly.

Just wondering if the rest of you have the same issues or if I'm missing 
something.
date: Mon, 14 Jul 2008 23:43:33 -0700   author:   Somebody

Re: Question for you "custom" GUI programmers out there   
Absolutely!
I spend an amazing percentage part of my time on these issues.

David Liebtag
date: Tue, 15 Jul 2008 08:47:05 -0400   author:   David Liebtag

Re: Question for you "custom" GUI programmers out there   
On Jul 15, 2:43 am, "Somebody"  wrote:
> For those of you who write custom GUIs (custom controls, fancy interfaces> etc), do you find that your code is filled with lots of "magic" numbers and
> special cases for the various OSes and animation modes, etc.
>
> I do all the custom UI work for my company, but I find that my code is now
> filled with a lot of special cases for (in matrix form lol):
>
> OS: NT4, Win95/98, NT5, XP, Win2k3, Vista
> Mode: Themed / Non-Themed / Aero
> Animation Flags: No anim, "fade" animation, "slide" animation
>
> Seems like I'm often doing a lot of special handling for 6 x 3 x 3 cases.
> Ok, I don't need to do special code for all those cases all the time, but it
> seems like for the "wacky" stuff I do, I often need to add  or
> subtract -7, etc. based on that stuff.
>
> The special cases are to get the pixels lined up correctly... for example
> with owner draw menus in fade mode, I inexplicably need to add  to get the
> stuff aligned. etc. for the metrics which have no clean way to obtain them.
>
> And for my recent project of custom painting tooltips... oh boy, I almost
> had to special case entire chunks of code to get it to work correctly.
>
> Just wondering if the rest of you have the same issues or if I'm missing
> something.

Use .net and you will not have these issues :-)

--
Ajay
date: Tue, 15 Jul 2008 12:01:19 -0700 (PDT)   author:   Ajay Kalra

Re: Question for you "custom" GUI programmers out there   
<snip>
>
>Use .net and you will not have these issues :-)

Riiiigghht.... :)

.NET is 100x worse for custom GUIs, there is very little you can do to "fix" 
stuff. I can hook, subclass, block, inject, etc stuff in C++ til I'm blue in 
the face. .NET hides all its internals from you, so there is often no way to 
fix stuff (other then of course calling native Win32).

Case in point:

I'm working on a C# app at work, and we were having a crash in the .NET Font 
Picker in a certain scenario... a google search showed others had the same 
problem with no work around. Can't do much about it... either catch the 
internal exception and have a non functioning dialog in that scenario, or 
call the Win32 one. If I had that same bug in the Win32 dialog, I could 
simply subclass the dialog and override the OK button.

Can't do that in C#.

I could "subclass" the dialog and override OK button, but I wouldn't have 
access to any of the controls.

Thats why I despise .NET for GUI work. They hide too much from you.

MFC/C++/Win32 rules the world :)
date: Tue, 15 Jul 2008 18:29:36 -0700   author:   Somebody

Re: Question for you "custom" GUI programmers out there   
On Jul 15, 9:29 pm, "Somebody"  wrote:
> <snip>
>
>
>
> >Use .net and you will not have these issues :-)
>
> Riiiigghht.... :)
>
> .NET is 100x worse for custom GUIs, there is very little you can do to "fix"
> stuff. I can hook, subclass, block, inject, etc stuff in C til I'm blue in
> the face. .NET hides all its internals from you, so there is often no way to
> fix stuff (other then of course calling native Win32).
>
> Case in point:
>
> I'm working on a C# app at work, and we were having a crash in the .NET Font
> Picker in a certain scenario... a google search showed others had the same
> problem with no work around. Can't do much about it... either catch the
> internal exception and have a non functioning dialog in that scenario, or
> call the Win32 one. If I had that same bug in the Win32 dialog, I could
> simply subclass the dialog and override the OK button.
>
> Can't do that in C#.
>
> I could "subclass" the dialog and override OK button, but I wouldn't have
> access to any of the controls.
>
> Thats why I despise .NET for GUI work. They hide too much from you.
>
> MFC/Cﯵꊟ rules the world :)

Dont know about your case. I like .Net significantly better than MFC
both in ease of development/maintenance and its cleanliness. There are
some quirks but I dont know of any system that doesnt have it.

--
Ajay
date: Wed, 16 Jul 2008 05:51:40 -0700 (PDT)   author:   Ajay Kalra

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us