Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get rid of that lousy bell?

Status
Not open for further replies.

JoeyDC

Programmer
Mar 24, 2013
18
US
I've set the bell off in every way I can think of, and this messagebox() function still sounds it when it pops up ---
Code:
LOCAL lnSomeThing as Number
SET BELL off
lnSomeThing=MESSAGEBOX('"Yes" to do something. "No" to do something else',4+16,"Do something?")

IF lnSomeThing=6
	** do something
ELSE 
	** do something else
ENDIF

Is this a Windows thing that VFP can't suppress?

Thanks

 
Sert Bell only is about chr(7) (bell), Messageboxes sounds are defined by windows theme. And a STOP Messagebox is supposed to make noise, as it's more important than a normal message.

If the sound is more annoying than not having the STOP symbol in the messagebox, then use 4 as second parameter, not 4+16, messageboxes make different noises, depending on the icon you add. A question mark also has no sound.

Bye, Olaf.
 
This is one of those things where the programmer is supposed to respect the user's choices. It is for the user to decide whether they want to hear the bell - or any other sound. It is not the developer's decision.

The user makes that choice from the Sounds applet in Control Panel. The point is that it's a global choice - it affects the entire user environment, not just your particular application.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I agree to Mike, that means you shouldn't fiddle with Themes/Sounds settings of windows.
The typical solution in an environment with collogues working together in an office is to mute speakers.

You can of course also circumvent the sound by writing your own messagebox window.

Bye, Olaf.
 
So it is a windows thing. But I'm old and grouchy, so at the risk of becoming un-welcome here, I'm going to have to respectfully disagree with you about not messing with Windows Themes from with within VFP. If you really believe that, then logic would require that you to agree that the VFP developer should also never mess with colors either, right? Just accept what Control Panel dictates in all aspects of all settings.

But I've seen some of the work of some pretty big dogs in the world of VFP who do not follow your advice. And I wonder why the developers of FPW and VFP included the ability for developers to make those changes. And please don't give me that lame excuse - "for backwards compatibility." It would seem to me that someone who has applications riddled @SAY's and @GET's sure wouldn't fret over losing his ability to set colors when he switched to VFP.
 
That was DOS times, when you had a single application running, no multi tasking.

It is part of the better UX (user experience) to have common looks and colors. You have still much room with backgrounds, images, you can do corporate identity.
I've seen older people fail on internet usage, because in the internet everbody brews his own beer (as we say here in germany). There is no common UI, not by look&feel and not at all by workflow.

You owe a reference, and if it's an FPD reference, as initially said, this was the DOS times, different outset.

To come back to the point, you're sample messagebox message is a question, so why combine it with the STOP icon messagebox? There is the question mark icon and it come with no unwanted sound, make use of it and your sound problem is solved.

Bye, Olaf.
 
Olaf,

Yes I can do that. Not a problem. I just never realized choosing the wrong icon would be so annoying.

Olaf said:
You owe a reference, and if it's an FPD reference, as initially said, this was the DOS times, different outset.
I don't understand that statement. Please enlighten me.
 
Well,

JoeyDC said:
But I've seen some of the work of some pretty big dogs in the world of VFP who do not follow your advice[/code]
You owe a reference for that.

If you're fine with using the question mark icon, then that's alsow fine. Yes, the sounds played match the severeness of the message type, and that is given by the icon. In Win7 you have the most advanced, neat, unannoying sounds, even for the STOP/alert Messagebox.

Bye, Olaf.
 
I guess you mean you want me to name names, as we say here in the US. Is this your way of calling me a liar? Just how much proof do you need if I reveal the name. Then are you going to say "Show me the code."?

Since you are evidently so interested, the person in question is Andy Kramek. Back in the CompuServe days, he sent me a program that he wrote which kept track, on our local computers, of the VFP threads that had been posted on CompuServe. The need for that program has long since passed and I have had several computers since then, so I no longer have the code, but he did do some interesting(unusual) things with colors.
 
I would want to see which apps you mean. If you talk of FPD, then that's it, it's own. No, I don't need to see code.

Bye, Olaf.
 
>he did do some interesting(unusual) things with colors.

Besides,

Themes don't take away all your control about coloring, you still can color items/rows of grids, for example, dynamicxxx properties are not turned down by themes.

Nobody hinders you to do anything a website may do, eg using images as toolbar and form buttons, using icons within menus or to illustrate listbox items. You're not at all limited to theme colors only.

Bye, Olaf.
 
The problem with setting your own colors is that some users may not be able to see them. It's much wiser to stick with the colors that the user has selected.

But that doesn't mean you can't tweak color in your application. Take a look at the section "Setting Colors" in this paper on my site:
There's a good discussion of how to update when the user changes the color scheme/theme in this one:
Tamar
 
Tamar said:
The problem with setting your own colors is that some users may not be able to see them. It's much wiser to stick with the colors that the user has selected

That's right. And to get back to the original question, a similar logic applies to sounds. Some users need to hear the bell (or beep, or whatever) to alert them to an unusual situation. Others might be working in a quiet environment, where any sound would be considered intrusive.

This is why users have the ability to determine these factors, and why developers should respect the users' choices.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I just want to add one sad truth about all this: A customer of us configures group policies to take away control from users in many system settings, unfortunately also about the themes. So indeed users do not always have the chance to configure their pc as they need. And this is a severe administrative error, if you ask me.

And while I always only thought coloring a button is a sample task you'd never really be asked to do, I once had to let a button be highlighted with a strong blue, instead of the light shade of blue XP adds to a focused command button in it's default theme. While that is a bad design of the XP theme, that really would have been a job of theme configuration and not of my programming.

Tamar, I never got the idea to bind to a themes change event, partially perhaps, because Windows handles redrawing all application forms anyway, and you don't have to do much, but if you add your own coloring, it gives you the best opportunity to give them the same base color as the theme and compute some colors in the same tone or for example calculate if white or black gives the best contrast.


And Joey, I hope to have shown, that playing by the rules doesn't take away so much freedom from you, even if you can argue, that these examples also break UI rules. A rule of thumb would always be, an application fits into the general UI. And if you say nobody does, to me that's still an argument to not follow the majority.

In the end there always will be some compromise between fully customizable looks and strictly defining what makes sense and is corporate identity or following other design guidelines. If you want the best UX, go Mac, Apple is very much more restrictive about that, and the result is they have a unique selling proposition.

Bye, Olaf.
 
To all,

Thanks for the very informative and instructive discussion. I thought I was asking a simple question and I'd get a simple answer.[bigsmile] But since I am my own user, this developer can cram (if he can figure out how) things down this user's throat and the user just has to take it.

Olaf, thanks for the links. I am familiar with Bernard's work.
Tamar, I have been reading your column, articles, and book contributions (I have several you have co-authored) for many years (in fact I have Hacker's Guide.) I am always blessed by your thoughts.

And now for my next question --- coming up soon
 
A customer of us configures group policies to take away control from users in many system settings, unfortunately also about the themes. So indeed users do not always have the chance to configure their pc as they need. And this is a severe administrative error, if you ask me.

Not just an administrative error. In some countries, a legal error if it prevents the user from making changes needed to accommodate a disability.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top