🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #1192

VFP 3.0��txtbtns��ĸĽ�Ӧ��

#1192
From: ���ܵ�Сʨ
Date: Sat, 18 Apr 1998 00:00
116 lines
7135 bytes
    Ϊ���Windows 95�ķ���,Microsoft��˾�Ƴ���Visual FoxPro 
For Windows 3.0(���VFP3.0)���ò�Ʒ������������̺Ϳ��ӱ�
���ѳ�Ϊ���������Ա�Ƴ�ʹ�õĿ������ߡ����ṩ��wizstyle.vcr
����еĸ������ʹ��,�����������Ա�����˺ܴ󷽱㡣
    txtbtns��wizstyle.vcr����е�һ����,Ҳ�����������Ա��VF
P 3.0���������������Ҫ�õ�����,����̫������ǵ�ʹ��ϰ��
,�����DZ��߽�����Ŀ��������и��ʵ�ʵ���Ҫ,��txtbtns�����
��һЩ�Ľ�

    �޸ij�������ʾ
    txtbtns����ʹ��ʱ,��ʾ�ı���(Caption)��ΪӢ��,����������
��Ϊ:Top,Prev,Next, Bottom,Find,Print,Add,Edit,Delete,Exit��
�޸ķ�������:
    ����,���뵽��Ŀ����(Project Manager),ѡ��Classҳ,չ��wiz
style.vcr���,�ҵ�t xtbtns��Modify�����txtbtns������޸�
����Class Designer��,����ѡ����������, �������ǵ�����(Prop
erties)������,��Layoutҳ�а����ǵ�Caption���ݸ�Ϊ���ġ�����
ѡ��Top�����������,�������а���ı�������\<Top�޸�Ϊ"��
��"����Ӧ�����ı���ɲ���:�ײ�,��һ��,��һ��,�ײ�,����,��ӡ,
����,�޸�,ɾ��,�˳���
    ���,��txtbtns���еķ���setcaption�����޸ġ�����Add��Edi
t���������ڲ�ͬ״̬(�༭/�DZ༭)����ʾ�ı��ⲻͬ,���ֱ���ת
������setcaption���������õġ�����txtbt ns�����Թ�����,�ڷ�
��ҳ(Methods)��ѡ��setcaption�޸����д��뼴�ɡ�
    #DEFINE ADD_CAPTION_LOC  "\<Add"��Ϊ
    #DEFINE ADD_CAPTION_LOC  "����"
    #DEFINE REV_CAPTION_LOC  "\>Rev"��Ϊ
    #DEFINE ADD_CAPTION_LOC  "�ָ�"
    #DEFINE SAVE_CAPTION_LOC  "\<Save"��Ϊ
    #DEFINE ADD_CAPTION_LOC  "����"
    �޸��겢�����,ʹ��txtbtns��ı���ͳ�Ϊ������ʾ�ˡ�
    ѡ��"����","�޸�"�����Ĺ�궨λ
    ��Ӧ�������ѡ��"����","�޸�"�������ϣ�������Զ��Ƶ�
ij�������λ�á������������ʾ�Ļ���,���Ƚ���һ�����ļ�
��bank.h,����Ӧ����������:
    #DEFINE BANK_ADD_LOC  "����"
    #DEFINE BANK_EDIT_LOC  "�޸�"
    Ȼ���ڽ���ij��Form�����ʱ,ѡ�����˵���Form��Include Fil
e��,��bank.h�ļ����ȥ,Ȼ��ѡ��txtbtns��"����"����������
�ķ���ҳ��,�޸�Valid����,�����������
    IF This.Caption=BANK_ADD_LOC
        ThisForm.Text1.SetFocus
    ENDIF
    ����"�޸�"����,�����������:
    IF This.Caption=BANK_EDIT_LOC
        ThisForm.Text1.SetFocus
    ENDIF
    ע:Text1Ϊϣ�����Զ��Ƶ�������
    ���Ӷ�Pageframe�ṹ��֧��
    ҳ���(Pageframe)�ṹ��Windows 95�г��õĽ�����ʽ��txtbt
ns����û���ṩ��ҳ��ܽṹ��֧��,�����ҳ��ܽṹ��ijһҳ��
ʹ��txtbtns�����ݽ��п���,��ô�ڷDZ༭״̬��,������е���
���Կ��ü��̵�Delete��ɾ��,����п���������ݵĶ�ʧ��
    ��ԭ����,txtbtns���setallprop����������һ���ݹ���,��
ֻ��"Container"�����˵ݹ�,��"Pageframe"û�н��еݹ顣����,��
ͨ��ControlCount����ֵ�������Ա,��"Page frame"����Ҫ��PageC
ount����ֵ�������ҳ(Page)�������г��޸ĺ��setallprop����,
���д�б���ַ�Ϊ���ӻ��޸ĵĴ��롣
    LPARAMETER oContainer
    * Checks for General fields
    LOCAL i,oControlParent,j
    IF PARAMETERS() =0
       m.oControlParent=THISFORM
    ELSE
       m.oControlParent=m.oContainer
    ENDIF
    IF m.oControlParent.BASECLASS=="Pageframe"
       m.j=oControlParent.PAGECOUNT
    ELSE
       m.j=m.oControlParent.CONTROLCOUNT
    ENDIF
    FOR i=1 TO m.j
    DO CASE
    CASE ATC("Container",m.oControlParent.CONTROLS[m.i].BASE
CLASS)#0
      THIS.setallpropp(m.oControlParent.CONTROLS[m.i])
    CASE ATC("Pageframe",;m.oControlParent.CONTROLS[m.i].BAS
ECLASS)#0
    THIS.setallpropp(THIS.PARENT)
    CASE ATC(m.oControlParent.CONTROLS[m.i].BASECLASS,"Check
Box,;
       TextBox,ComboBox,OleBoundcontrol")#0
    m.oControlParent.CONTROLS[m.i].ENABLED=THIS.EditMode
    CASE ATC(m.oControlParent.CONTROLS[m.i].BASECLASS,"EditB
ox")#0
    m.oControlParent.CONTROLS[m.i].READONLY=!THIS.EditMode
    IF !THIS.HasMemo
        WITH m.oControlParent.CONTROLS[m.i]
      THIS.EditForeColor=.FORECOLOR
      THIS.EditDisForeColor=.DISABLEDFORECOLOR
      THIS.EditBackColor=.BACKCOLOR
      THIS.EditDisBackColor=.DISABLEDBACKCOLOR
      THIS.HasMemo=.T.
    ENDWITH
    ENDIF
    m.oControlParent.CONTROLS[m.i].FORECOLOR=IIF;
        (THIS.EditMode,THIS.EditForeColor,THIS.EditDisForeCo
lor)
    m.oControlParent.CONTROLS[m.i].BACKCOLOR=IIF;
        (THIS.EditMode,THIS.EditBackColor,THIS.EditDisBackCo
lor)
    CASE ATC(m.oControlParent.CONTROLS[m.i].BASECLASS,"Grid"
)#0
        m.oControlParent.CONTROLS[m.i].READONLY=!THIS.EditMo
de
        m.oControlParent.CONTROLS[m.i].DELETEMARK=THIS EditM
ode
    ENDCASE
    ENDFOR
    �����������޸�,��Windows 95������,VFP 3.0��ʹ�õõ���֤
�����ǵľ�����,��VFP  3.0���ṩ����,Ӧ�������ʵ��Ӧ�õ���Ҫ
���б�Ҫ���޸�,���ܹ������Ͽ�����Ҫ����⡣

--
�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn]
Technical Details
Message-ID: <3O9Qj7$tzB@bbs.nju.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: fc86e,809182d9beb9ae4b,start
X-Google-Attributes: gidfc86e,public
From: pipishi.bbs@bbs.nju.edu.cn (���ܵ�Сʨ)
Subject: VFP 3.0��txtbtns��ĸĽ�Ӧ��
Date: 1998/04/18
Message-ID: <3O9Qj7$tzB@bbs.nju.edu.cn>
X-Deja-AN: 345308564
X-Filename: Programming/M.892871287.A
Organization: nju_bbs
Newsgroups: cn.bbs.comp.program