Editprotect and popup and combo buttons.

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Editprotect and popup and combo buttons.

#1 Post by PedroAlex »

Hello comunity.

My situation is ,

I want the users can not modify the get, remove every keyboard entry, but still will allow to click on popup button or combo button.
How I can do this??
Any ideia, I appreciate.
Thanks in advance.

i put here some code to be evaluate..

Code: Select all

#INCLUDE "dcdialog.CH"
#INCLUDE "appevent.CH"
#INCLUDE "dcicon.CH"

* -----------

FUNCTION Main()

LOCAL dDate := Date(), GetList[0], GetOptions, dPaym:=Space(20), aPay:={'Visa','MasterCard','A.Express'}

@ 00,00 DCSAY 'Enter Date' Get dDate EDITPROTECT {|| .t. } POPUP {|d|DC_PopDate(d,,,,'Seleccione Data',,2)}

@ 02,00 dcsay '   Payment' get dPaym EDITPROTECT {|| .t. } ;
        					   COMBO                       ;
        					   HEIGHT 7 WIDTH 20           ;
        					   DATA aPay ELEMENT 1

DCREAD GUI FIT ADDBUTTONS MODAL SETAPPWINDOW

RETURN nil
PROC appsys
RETURN
Best Regards
Pedro Alex
Pedro Alexandre

User avatar
Tom
Posts: 1173
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Editprotect and popup and combo buttons.

#2 Post by Tom »

Hi, Pedro.

Set DC_GetPopupProtectHide(.T.) somewhere in your app. This will automatically hide popup- and combo-buttons if a get is edit-protected.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: Editprotect and popup and combo buttons.

#3 Post by PedroAlex »

Tom. Thanks for reply.

I did not explain correctly.
I want the user can click only on the button and change the get only from the popup or combo button, but de get protected by editprotect.
It is possible?

Thanks for attention.

Pedro
Pedro Alexandre

User avatar
Tom
Posts: 1173
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Editprotect and popup and combo buttons.

#4 Post by Tom »

Hi, Pedro.

Code: Select all

cTest := Space(30)
@ 1,1 DCGET cTest POPUP {||cTest := MyPopUpValue} KEYBLOCK {|a,b,o|o:Undo()}
Easier way: Create DCCOMBOBOXes instead. ;)
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

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

Re: Editprotect and popup and combo buttons.

#5 Post by rdonnay »

I want the user can click only on the button and change the get only from the popup or combo button, but de get protected by editprotect.
Try this:

@ .. DCGET xVar POPUP bPopup KEYBLOCK {|a,b,o|o:undo()}
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: Editprotect and popup and combo buttons.

#6 Post by PedroAlex »

Roger and Tom.
Many thanks for you try support my question,
but it looks you do not understaind my problem.

take a look on code sample I poste on first topic.

The problem is :
IF EDITPROTECT is .t. I can not insert data from keyborad, and I can not choose data from the combo button or popup button too, and this is the problem.
I want the combo or popu button is enable and work fine when the editprotect clause is .t.. Something like Dc_Popupprotect( .f. ). This way the get can be protect but the button not, and the user can change the get only from the data result the button code ( array or browse a file ).

This can prevent for many errors typical from data inserted from keyboard.
I can do this with a separated button and get, but will be more easy if it is included on dcsay....get....combo or popup.
the developper can control the protect clause of the get and the protect clause of the button separately.

thanks again and sorry for insist.

Best regards
Pedro Alex.
Pedro Alexandre

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Editprotect and popup and combo buttons.

#7 Post by BruceN »

Why not use a valid? like:

LOCAL a_IP := {'Invoice','Product','Department','Vendor'}, aIP:={'I','P','D','V'}

@ 7, 1 DCsay "Sort By"
@ 7, 15 dcget sortby pict '!';
TABSTOP;
GETSIZE 2.5;
GETFONT '8.ARIAL';
VALID {|o|ASCAN(aIP,o:GetData()) > 0};
COMBO HEIGHT a_len(a_IP) WIDTH a_wd(a_IP) DATA a_IP RETURN {|n|aIP[n]};
lostfocus{||dc_getrefresh()}


User can type or select data... but it fhat forces the data to be from your list.. isn't that what you want?

if so.... glad I could help.
There are only 10 kinds of people - those who understand binary and those who don't :)

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

Re: Editprotect and popup and combo buttons.

#8 Post by rdonnay »

but it looks you do not understaind my problem.
I DO understand your problem.

If you want the buttons to work, you must removed the EDITPROTECT clause.
If you want to prevent keyboard entry, you must use the .. KEYBLOCK {|a,b,o|o:undo()} clause.
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: Editprotect and popup and combo buttons.

#9 Post by PedroAlex »

Roger, you're right!

KEYBLOCK clause works fine..

many thanks for your time.

Best Regards.

Pedro Alex
Pedro Alexandre

Post Reply