AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Contents · Computing

The application window

Lessons 37–38 · 2 lessons · N. I. Taylaqov (general editor), A. B. Akhmedov, M. D. Pardayeva, A. A. Abdug‘aniyev, U. M. Mirsanov. Informatics and Information Technologies, Grade 10, 1st edition. “Extremum-Press”, Tashkent, 2017
38

Practical lesson

Textbook: pp. 89–90
GoalBuilds a first application independently: sets size, position, title and colour, runs and tests it and saves it in the right folder.
New words
Save As: saving under a new name or in a new place · Save AsClose All: closing all files of the project · Close Alltesting: running the application to see the result · tekshirishcolour name: a constant such as clYellow · rang nomi
Explanation

In the practical lesson several small applications are created one after another. Each time open a new folder, start with File – New – Application, set the properties in the Object Inspector, test with F9 and save with File – Save All. The first application: Width = 500, Height = 350, Caption = 'Ilova 1', Color = clYellow, Left = 200, Top = 100. The second application opens near the middle of the screen: the window width is subtracted from the screen width and the result is divided by two, which gives the Left value. When testing, check both the size and the position of the window by eye and compare the result with the expected numbers. After the work close everything with File – Close All.

💡 Where will I use this?
In real life

A pupil writing a small program changed only one property at a time and ran it to see. When the window suddenly looked odd, the pupil knew at once that the last change had caused it. Testing everything only at the end would have made finding the cause much harder.

Who uses it

Programmers, mechanics and electricians split complex work into small steps and test each one separately.

Try it today

In your next multi-step job, such as drawing a picture, stop and check after each step, not just at the end.

Worked examples
QuantityScreenWindowStart point
width1920600Left = (1920–600)/2 = 660
height1080400Top = (1080–400)/2 = 340
If the screen is 1920 pixels wide and the window is 600 pixels wide, to centre it horizontally Left = (1920-600)/2 = 660. If the height is 1080 and the window is 400, Top = (1080-400)/2 = 340.
A third application: Width = 300, Height = 300 (a square), Caption = 'Kvadrat', Color = clAqua. For the window to be square, Width and Height must be equal; its area is 300·300 = 90 000 square pixels.
Class activity

“The window in the middle”: a pair chooses the window size, calculates Left and Top, tests the application and shows that the calculation matches the position on the screen.

Practice
1
Which two properties must be equal for the window to be a square?
2
The screen is 1600 pixels wide and the window 400. What is Left for centring?
3
Which command closes all files of the application?
4
Why is it useful to save the application before testing it?
Story of the Week · The Khwarizmi WayIs the discount real?Close the week: all of this week’s subjects in one storyRead →