forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%rb with callback function

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
EKruck



Joined: 09 Jan 2010
Posts: 224
Location: Aalen, Germany

PostPosted: Mon Nov 03, 2014 6:10 pm    Post subject: %rb with callback function Reply with quote

Using %^rb with callback function which returns zero does not close the window !? Why?

Erwin
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Mon Nov 03, 2014 11:10 pm    Post subject: Reply with quote

Simply: Radio buttons and check boxes are not command buttons.

See the Windows User Experience guidelines - although to understand what is written there, you may need to learn the language of Microsoft!

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Nov 04, 2014 11:34 am    Post subject: Reply with quote

This behaviour is the result of the ClearWin+ coding and I assume that it is the intended design. It does mean that %rb does not fit the general behaviour and the documentation ought to say this.

If you want the main window to close then you could do something like the following...

Code:
program main
integer i,winio@,ctrl,ctrl2
common ctrl2
integer,external::cb
ctrl = 1
i=winio@("%^rb[Radio]&", ctrl, cb)
i=winio@("%lw", ctrl2)
end

integer function cb()
integer ctrl2
common ctrl2
ctrl2 = 0
call window_update@(ctrl2)
cb = 0
end
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Nov 04, 2014 12:20 pm    Post subject: Reply with quote

Paul,

Clearwin+ follows the Windows standard. Using a check box or radio button as a command button would be 'unusual behaviour'. Of course, a programmer can program whatever he wants, but the poor user has to put up with it.

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Tue Nov 04, 2014 1:18 pm    Post subject: Reply with quote

Would be great if CWP had debug mode and explicitly told you with warnings, comments or error messages what you all say about Microsoft Defaults in this case. Otherwise user loses a day to figure out what the heck all other controls work this way but radiobutton does not without any visible reason or logic. Modern compilers must become much more verbose with error explanations then the old generation ones.
To turn user's stress and a lot of swear into enjoyment I'd allow this "wrong" behavior because it is 1000 times less confusing and less antiintuitive then the opposite.
BTW, let us know where specifically MS forbids this behavior.
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 224
Location: Aalen, Germany

PostPosted: Fri Nov 07, 2014 11:18 am    Post subject: Reply with quote

Paul,

this is what I did. I tried also to use DESTROY_WINDOW@, but without success.
The purpose was to change parameters, text and buttons on the window and repaint the window, when switching to another radio button.

Now I used another way and changed text on the buttons and parameter values etc. and update the existing window.

I would have preferred the first way, because I am more flexible with my own buttons.

Erwin
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Nov 07, 2014 12:51 pm    Post subject: Reply with quote

Dan,

To find out what a 'command button' is, Google may be your friend. Using search words 'MSDN' 'command' and 'button' throws this up as its first offer:

http://msdn.microsoft.com/en-us/library/we7tc2af(v=vs.80).aspx

and it tells you:

'A command button is typically used to start an event that performs an action such as closing a form, moving to a different record, printing a report, and so on.'

Some controls have the essential characteristic of the command button i.e. 'starting an event that performs an action'.

Radio buttons and check boxes do not have that characteristic of the command button. However, there are controls that do allow the user to select one of a set of options and start an event. In this category one has:

Drop down lists
Combo boxes
Listview and Treeview controls
Command links (for 'ribbons')
Menus
Toolbar graphical icon buttons

and so on. A lot of this can be gleaned from the Windows User Experience Guidelines, but as I said, it takes a lot of reading to get to the bottom of it all - and it isn't always easy to understand for someone like me who is self-taught.

On another matter, while reading various things in MSDN to answer your question, I came across a 'line control':

http://msdn.microsoft.com/en-us/library/aa369760(v=vs.85).aspx

This draws a line in a window. Certainly, no user would think of clicking on such a control, and it is one of the controls that (like check box or radio button) does not have the command button characteristic. However, the point is that it is a thing I've asked for in a previous wishlist that ought to be simple for Clearwin+ to have implemented.

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Fri Nov 07, 2014 10:38 pm    Post subject: Reply with quote

Eddie,
Thanks for the links and excerpts. I now even stronger think that radiobutton must be allowed to do what is not allowed. It is user who decides, Microsoft just suggests. Logic of CWP says it has to be allowed. CWP being smart may see that and suggest to user not to do certain things based on guidelines. But still such restrictions and guidelines should not be hard coded into CWP. CWP has to allow everything just in case Microsoft changes its stupid mind or users tastes change. Say, there must be no dynamically not upgradable controls. Styles must be easily changeable. Otherwise CWP will be quickly obsolete. For example can you imagine CWP GUI on the tablets or cellphones? I hardly can
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Nov 07, 2014 11:18 pm    Post subject: Reply with quote

Dan,

From the outset I conceded that the programmer is free to program what he/she wants. It is the user who may pay the price with unexpected behaviour, but the programmer may well suffer - with complaints or support calls.

A proper use of a check box is in a dialogue asking the user to confirm or deny a deletion, where it is used for Don't ask me again, with command buttons Delete and Cancel. Don't ask me again doesn't tell the program to delete or not delete, and to be frank, a user who selected the check box would not expect the deletion to occur.

Similar things apply to radio buttons.

In my view, if you want a Command type control, then program one!

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Nov 08, 2014 8:38 pm    Post subject: Reply with quote

Quote:
A proper use of a check box is in a dialogue asking the user to confirm or deny a deletion, where it is used for Don't ask me again, with command buttons Delete and Cancel. Don't ask me again...


Well, Eddie, you want people to die programming and editing and debugging and fixing and modifying and...and...and...I literally have no choice but make radiobuttons do command job. Any complex GUI would be super-annoying for programmer and the user with all that confirmations which means that each radiobutton is also doing command job and doing it in one click or unclick. Opening, closing, plotting, starting, stopping, only rarely asking for confirmations in dangerous or confusing places. Look at this snippet from such GUI. There are thousands and thousands of radiobuttons and no end of their amount. I have may be 5000 of them, some are even generated automatically like the table in the middle below. Add here automatic generation of radiobutton dialog boxes and then clicking clicking clicking for confirmations would kill the toughest guy on earth

Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sun Nov 09, 2014 12:57 pm    Post subject: Reply with quote

Hi Dan,

It may not scare your users, but it sure as heck frightens me!

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sun Nov 09, 2014 1:32 pm    Post subject: Reply with quote

Very Happy Actually everything here is self-explanatory. Plus each control in CWP has convenient for user and programmer bubble help. In most cases you also immediately see the action - great for comparison. If not sure for hidden effect of your mouse action click Cancel and all will return back to initial state.

( CWP GUI is a must for every programmer. But you know that better then anybody else, this was basically my advertisement for those who do not use one of the greatest code usability enhancements. One more interesting thing about GUI I can not now live without is that it helps me to find anything in the very large code which has as many variables as some telephone books have names. )
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group