How can I enable and disable radio buttons in a zRadioController?

Article ID: 852
Last updated: 05 Feb, 2008
Article ID: 852
Last updated: 05 Feb, 2008
Revision: 1
Views: 2609
Posted: 02 Sep, 1997
by Dean J.
Updated: 05 Feb, 2008
by Dean J.
Problem


This is a function added to the zApp code base to enable or disable radio buttons on a zRadioController.


Cause


There was no function that could do this earlier.


Action


Add the new member function to zRadioController class in the public section. It should look like this:

Filename is zApphformdlg.hpp  approx line is 595 (in zApp 3.0)

      void enableAll( BOOL enable = TRUE);

Then add this code in zapp3source adiogrp.cpp

//added to disable or enable all radio buttons

void zRadioController::enableAll(BOOL enable ) {
   zWindowDlistIter trav(&(WndParent->kidslist()));
   zRadioButton *win;
   while ((win=(zRadioButton*)trav())!=0) {
       if (win->ctrlId()>=_idLo &&
win->ctrlId()<= _idHi) {
         enable ? win->enable()
: win->disable() ;
      }
   }
}

When you are done, be sure to rebuild your zApp library.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 852
Last updated: 05 Feb, 2008
Revision: 1
Views: 2609
Posted: 02 Sep, 1997 by Dean J.
Updated: 05 Feb, 2008 by Dean J.

Others in this category