Classic instance-MDI window with basemap

Source: Internet
Author: User

1. Create the main menu m_main.

2. Create the main Window w_main and set its property Window Type to mdihelp !, Set the MenuName attribute to m_main.

3. Create the w_pic image Window, place the picture control in the Window, and name it p_1; set the w_pic attribute and set the Window Type attribute to popup !, Select visible. All other properties are canceled.

4. Write w_pic code:

(1) define instance variables)

Boolean isfullscreen

Integer oldwidth, oldheight

(2) Compile an open () event:

Isfullscreen = true

Oldwidth = p_1.width

Oldheight = p_1.height

(3) Compile the resize () event

If isfullscreen then

P_1.x = 0

P_1.y = 0

P_1.resize (newwidth, newheight)

Else

P_1.resize (oldwidth, odlheight)

Integer ax, ay

Ax = (newwidth-oldwidth)/2

If AX <0 Then AX = 0

Ay = (newheight-oldheight)/2

If ay <0 then ay = 0

P_1.x = AX

P_1.y = ay

End if

(4) define function: Init (string as_picture, Boolean as_isfullscreen) Return (none)

Parameters:

Access: public return type: none function name: init

Pass by: value argument type: string argument name: as_picture

Pass by: value argument type: boolean argument name: as_isfullscreen

Code:

P_1.originalsize = ture

P_1.picturename = as_picture

Oldheight = p_1.height

Oldwidth = p_1.width

P_1.originalsize = false

This. Resize (this. Width, this. Height)

5. Write the w_main code:

(1) define instance variables)

W_pic mdipicture

String mdipicturename

Boolean mdiisfullscreen

(2) define function: setpicture ()

Parameters:

Access: public return type :( none) function name: setpicture

Pass by: value argument type: string argument name: as_picture

Pass by: value argument type: boolean argument name: as_isfullscreent

Code:

Mdipicturename = as_picture

Mdiisfullscreen = as_isfullscreen

If isvalid (mdipicture) then

Mdipicture. init (mdipicturename, mdiisfullscreen)

Mdipicture. resize (this. width, this. height)

End if

(3) Compile the resize () event:

If isvalid (mdipicture) = false then

Opensheet (mdipicture, this)

Mdipicture. init (mdipicturename, mdiisfullscreen)

Mdipicture. x = 0

Mdipicture. y = 0

End if

Mdipicture. resize (newwidth, newheight)

6. Compile the application open () event

Open (w_main)

W_main.setpicture ("back.bmp", true)

 

Figure 1: Minimize the window

Figure 2: maximized window

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.