Action Clause dcradiobutton on firing Express 259 versus 264

This forum is for eXpress++ general support.
Post Reply
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Action Clause dcradiobutton on firing Express 259 versus 264

#1 Post by Cliff Wiernik »

I use a radio button dialog to select index orders for a file. Just started beta testing Xbase++ 2.0 with Express 264 and a user reported this. With Xbase++ 1.9 and Express 259 or Xbase++ 2.0 and Express 259, If I do any of the following, the action button is fired and the index order is changed to the selected item:

a. Click on the radio button caption with the left mouse button
b. move the selected item to the radio button via cursor arrow keys and press the space bar
c. move the selected item to the radio button via cursor arrow keys and press the enter key

However, if I switch the express version from 259 to 264 and using Xbase++ (I did not try 264 with 2.0), the following works:

a. Click on the radio button caption with the left mouse button
b. move the selected item to the radio button via cursor arrow keys and press the space bar

But for C:
c. move the selected item to the radio button via cursor arrow keys and press the enter key - the radio button selected changes and the cursor moves to the next radio button, but the ACTION clause is not fired and thus the index order does not change as it should.

I will get together a small sample for test purposes and hopefully the problems moves to the small sample also.

Cliff

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#2 Post by Cliff Wiernik »

I have attached the test program. I am using the TAB Group. Compile program in Xbase++ 2.0 and simply switch between the 259 version and 264 version of Express.

In the 259 version, clicking a button or using the cursor keys to navigate and press the space bar or the enter key will cause the you "This is Option X" caption to be updated. Now switch to the 264 version of express and the caption only changes if you click on the radio button/caption or navigate to the button and press the space bar. If you navigate to the button and press the enter key, it does not update the "This is Option X" caption although the radio button selected does change.

Code: Select all

#include "dcdialog.ch"

FUNCTION main()

/*
RADIO BUTTONs, CHECKBOX, FIXED SIZED DIALOG

This sample demonstrates three DCRADIO button objects and a DCCHECKBOX
object with FIXED sizing of the dialog window .  The window is MODAL.
Coordinates are both TEXT-based and PIXEL-based.  The Radiobutton
objects are attached to a DCGROUP as the parent.  The Radiobutton group
is HIDDEN and SHOWN by clicking the Checkbox.  A DCSTATIC text box
is used to display the value chosen by the Radio Buttons.
*/

   LOCAL GetList := {}, cRadio := '', lCheck := .f., oRadioGroup, ;
         GetOptions, oStatic

   @ 1,1 DCCHECKBOX lCheck                    ;
      PROMPT 'Hide Radio Buttons'

   @ 3.2, 1 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT      ;
      SIZE 30, 1.5                            ;
      OBJECT oStatic                          ;
      COLOR GRA_CLR_DARKBLUE, GRA_CLR_WHITE   ;
      FONT '16.Helv'

   @ 6,1 DCGROUP oRadioGroup                  ;
      SIZE 20, 5                              ;
      CAPTION 'Choose an Option'              ;
      HIDE {||lCheck}

   @  15,10 DCRADIO cRadio                    ;
      VALUE 'This is Option 1'                ;
      PROMPT 'Option 1'                       ;
      PARENT oRadioGroup                      ;
      ACTION {||oStatic:SetCaption(cRadio)}   ;
      PIXEL                                   ;
      TABGROUP XBP_BEGIN_GROUP ;
      TABSTOP 


   @  35,10 DCRADIO cRadio                    ;
      VALUE 'This is Option 2'                ;
      PROMPT 'Option 2'                       ;
      PARENT oRadioGroup                      ;
      ACTION {||oStatic:SetCaption(cRadio)}   ;
      PIXEL                                   ;
      TABGROUP XBP_WITHIN_GROUP ;
      TABSTOP 

   @  55,10 DCRADIO cRadio                    ;
      VALUE 'This is Option 3'                ;
      PROMPT 'Option 3'                       ;
      PARENT oRadioGroup                      ;
      ACTION {||oStatic:SetCaption(cRadio)}   ;
      PIXEL                                   ;
      TABGROUP XBP_END_GROUP ;
      TABSTOP 

   DCGET OPTIONS                              ;
      WINDOW HEIGHT 300                       ;
      WINDOW WIDTH 240

   DCREAD GUI ;
      TITLE 'Fixed-Size Dialog' ;
      BUTTONS DCGUI_BUTTON_OK + DCGUI_BUTTON_CANCEL ;
      MODAL ;
      OPTIONS GetOptions

ReTURN nil
*** END OF EXAMPLE ***

Code: Select all

//
// Project - Definition - File created by PBUILD Version  1.70.267
// Date: 01/31/2002 Time: 20:10:28
//

[PROJECT]
    COMPILE       = xpp
    COMPILE_FLAGS = /q
    DEBUG         = yes
    GUI           = yes
    LINKER        = alink
    LINK_FLAGS    =
    RC_COMPILE    = arc
    RC_FLAGS      = /v
    sample5.XPJ

[sample5.XPJ]
    sample5.EXE

[sample5.EXE]
// $START-AUTODEPEND
    dclipx.lib
// $STOP-AUTODEPEND
    sample5.prg

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#3 Post by rdonnay »

Here is a fix for you.

Copy _DCCLASS.PRG to \exp20\source\dclipx and run build20.bat.

This fix will be in build 265.
Attachments
_dcclass.zip
(42.11 KiB) Downloaded 737 times
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#4 Post by Cliff Wiernik »

There are alot of other changes in that file. It fixes the problem but I want to make certain that the other changes are compatible or should I just put in the radiobox changes.
Last edited by Cliff Wiernik on Thu Oct 13, 2016 7:20 pm, edited 2 times in total.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#5 Post by Cliff Wiernik »

Posted in error.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#6 Post by rdonnay »

If you don't trust my latest code, then you can simply add the below code to build 264 (line 3352).

Code: Select all

IF Valtype(::actionBlock) == 'B'
  Eval(::actionBlock,self)
ENDIF
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#7 Post by Cliff Wiernik »

That is not the case. I just wanted to be certain that the other changes to _dcclass.prg did not have other dependencies in other prg files that I am not changing.

Was there a reason why that code appears to have been removed sometime between 259 and 264.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#8 Post by rdonnay »

Was there a reason why that code appears to have been removed sometime between 259 and 264.
There was no reason other than it appears it was removed accidently.

I added a new feature in build 262:

1383. Added a new RADIOGROUP clause to the @..DCRADIOBUTTON command. This
accepts a variable that must be initialized as an empty array. This
feature eliminates the need to have unique parents for each radio
group. See the sample in \exp20\samples\radiogroup.
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Action Clause dcradiobutton on firing Express 259 versus

#9 Post by Cliff Wiernik »

Thanks.

I am using the entire _dcclass.prg file.

Cliff

Post Reply