Home > database >  How to use PFc. To make the inside of the window controls have the functions of dynamic change size?
How to use PFc. To make the inside of the window controls have the functions of dynamic change size?

Time:09-29

I'd like to control dynamic change in PB window size, or at run time to dynamically change window mle_1 and dw_1 sizes of empty, listening to others in of_rgister dw_1, (1) of_rgister (dw_2, 2) compile time suggest a unknow funcation name 'of_rgister exactly how to do? Hope expert advice, I appreciate!!!!!!!!!!!!!! And hope that points in detail, I used to use dellphi and Java or a first-time pb,
QQ: 634287660

CodePudding user response:

PFC is through pfc_n_cst_resize class management control in dynamic scaling the size or location,
Of_register (agru_list) is registered for the zoom control, the control to pfc_n_cst_resize inside to find a specific code,
Digression, "dellphi and Java or a first-time pb" pb has not both of them a good,

CodePudding user response:

In the window to write

Enclosing of_setresize (true)
Enclosing inv_resize. Of_register (dw_1, 0, 0, 100, 100)

Can be

CodePudding user response:

Code, give you a window directly inherited his line, support nested TAB controls
===============================================
$PBExportHeader $w_size. SRW
$PBExportComments $automatically adjust the window size of the base class
Forward
Global type w_size from window
End type
End forward

Global type w_size from window
The integer width=2533
The integer height=1408
Boolean titlebar=true
Boolean controlmenu=true
Boolean minbox=true
Boolean maxbox=true
Boolean the resizable=true
Long backcolor=15780518
String icon="AppIcon!"
Boolean center=true
The event ue_position ()
End type
Global w_size w_size

The type variables
Boolean ib_autoresize=true

The integer ii_orgwidth, ii_orgheight

Dragobject ido_autosizecontrl []
, irl_wbl irl_ybl real irl_xbl [], [] [], irl_hbl []

End the variables

Forward as
Public subroutine wf_init ()
End as

The event ue_position; Integer I, j, k, li_dwcount=0, li_ret, li_controls, js
Long ll_width ll_height, ll
TAB l_tab
Userobject luo_control

Ll_width=this. Workspacewidth ()
Ll_height=this. Workspaceheight ()

Js=1
Li_controls=upperbound (enclosing control [])
FOR I=1 TO li_controls
CHOOSE a CASE enclosing control [I] typeof ()
CASE the line! , a rectangle! , roundrectangle! , oval!
The continue
In CASE the ELSE
Ido_autosizecontrl [js]=this. Control [I]
Irl_xbl [js]=ido_autosizecontrl [js]. X/ll_width
Irl_ybl [js]=ido_autosizecontrl [js] y/ll_height
Irl_wbl [js]=ido_autosizecontrl [js]. Width/ll_width
Irl_hbl [js]=ido_autosizecontrl [js]. Height/ll_height
Js + +
IF this. Control [I] typeof ()=TAB! THEN
L_tab=control [I]
FOR j=1 TO UpperBound (l_tab. Control [])
FOR k=1 TO UpperBound (l_tab. Control [j]. Control [])
CHOOSE a CASE l_tab. Control [j]. Control [k]. Typeof ()
CASE the line! , a rectangle! , roundrectangle! , oval!
The continue
In CASE the ELSE
Ido_autosizecontrl [js]=l_tab. Control [j]. Control [k]
Irl_xbl [js]=ido_autosizecontrl [js]. X/ll_width
Irl_ybl [js]=ido_autosizecontrl [js] y/ll_height
Irl_wbl [js]=ido_autosizecontrl [js]. Width/ll_width
Irl_hbl [js]=ido_autosizecontrl [js]. Height/ll_height
Js + +
IF l_tab. Control [j]. Control [k]. Typeof ()=userobject! THEN
Luo_control=l_tab. Control [j]. Control [k]
FOR ll=1 TO UpperBound (luo_control. Control [])
CHOOSE a CASE luo_control. Control [ll] typeof ()
CASE the line! , a rectangle! , roundrectangle! , oval!
The continue
In CASE the ELSE
Ido_autosizecontrl [js]=luo_control. Control [ll]
Irl_xbl [js]=ido_autosizecontrl [js]. X/ll_width
Irl_ybl [js]=ido_autosizecontrl [js] y/ll_height
Irl_wbl [js]=ido_autosizecontrl [js]. Width/ll_width
Irl_hbl [js]=ido_autosizecontrl [js]. Height/ll_height
Js + +
The END CHOOSE
NEXT
END the IF
The END CHOOSE
NEXT
NEXT
END the IF
IF this. Control [I] typeof ()=userobject! THEN
Luo_control=control [I]
FOR j=1 TO UpperBound (luo_control. Control [])
CHOOSE a CASE luo_control. Control [j]. Journal of typeof ()
CASE the line! , a rectangle! , roundrectangle! , oval!
The continue
In CASE the ELSE
Ido_autosizecontrl [js]=luo_control. Control [j]
Irl_xbl [js]=ido_autosizecontrl [js]. X/ll_width
Irl_ybl [js]=ido_autosizecontrl [js] y/ll_height
Irl_wbl [js]=ido_autosizecontrl [js]. Width/ll_width
Irl_hbl [js]=ido_autosizecontrl [js]. Height/ll_height
Js + +
The END CHOOSE
NEXT
END the IF
The END CHOOSE
NEXT

End the event

Public subroutine wf_init (); The event ue_position ()
End subroutine

The event the resize; The Integer li_controls, I, j
String ls_xbl ls_ybl, ls_wbl, ls_hbl

IF ib_autoresize THEN
//automatic zoom
Enclosing Setredraw (false)
Li_controls=upperbound (ido_autosizecontrl [])
FOR j=1 TO li_controls
Ido_autosizecontrl [j]. Journal of x=irl_xbl [j] * newwidth
Ido_autosizecontrl [j]. J y=irl_ybl [j] * newheight
Width=irl_wbl ido_autosizecontrl [j]. [j] * newwidth
Ido_autosizecontrl [j]. Journal of height=irl_hbl [j] * newheight
NEXT
Enclosing Setredraw (true)
END the IF

End the event

On w_size. The create
End on

On w_size. Destroy
End on

The event open; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related