User`s guide
An Address Book Reader (GUIDE)
The Address Book
Resize Function
The address book
defines its own resize function. To use this resize function,
you must set the A
pplication Options dialog box Resize behavior to
User-specifie
d
, which in turn sets the figure’s Resi zeFcn property to:
address_book('ResizeFcn',gcbo,[],guidat a(gcbo))
Whenever the u
ser resizes the figure, MATLAB software calls the
ResizeFcn
subfunction
in the address book code file (
address_book.m)
Behavior of the Resize Function
The resize f
unction allows users to make the figure wider, enabling it to
accommodat
e long names and numbers, but does not allow the figure to be
made narro
wer than its original width. Also, users cannot change the height.
These rest
rictions simplify the
resize function, which must maintain the
proper pro
portions between the figure size and the components in the GUI.
When the u
ser re siz es the figure and release s the mouse, the resize function
executes
. Unless the user has maximized or docked the figure, the resize
function
enforces the height of the figure and resets the width o f the Contact
Name fie
ld. The following sections describe how the
resize function works.
Change the Width
If the n
ew width is greater than the original width, set the figure to the new
width.
The si
ze of the Contact Name text box changes in proportion to the new
figur
e width. This i s accomplished by:
• Obta
ining the figure width as a ratio of its original width.
• Expa
nding or contracting the width of the Contact Name field
prop
ortionally.
If t
he new width is less than the original width, u se the original width. The
cod
e relies on the fact that the original width of the Contact Name field
is 7
2 character units.
10-95