|
Post by bob82604 on Mar 14, 2013 3:29:38 GMT 1
How do i properly size a form to fit the size I want? The default form size is 4800W X 3600H. 4800W X 3600H what? What ever it is it is too small. I want to make a form that is 800W X 600H in pixels. Is there a formula for computing back and forth?
|
|
|
Post by ventilo25 on Mar 14, 2013 14:51:43 GMT 1
OpenW # 100, 10, 10, 800, 600, -1 'OpenW 1 Do Sleep Loop Until IsNothing(Me) bye And following the instructions to Form command Form Command : Creates a (MDI) form. Syntax Form [options] fname [= [title$],[x],[y],[ w, h] ] Form [options] MdiParent fname [= [title$],[x],[y],[ w, h] ] Form [options] MdiChild Parent form, fname [= [title$],[x],[y],[ w, h] ] Form [options] Owner form, fname [= [title$],[x],[y],[ w, h] ] options: [Tool] [Full] [Hidden] [Client3D] [Help] [Top] [Palette] [NoCaption] [NoTitle] [Fixed][Default] fname, form: Form Object variable title$: sexp, optional x, y: iexp, optional w, h: iexp, optional
Description
A Form is a window or dialog box that makes up part of an application's user interface. The Form command creates a Form object with the specified name. The name is used in code to identify the form. The name property must start with a letter and can be a maximum of 40 characters. It can include numbers and underline (_) characters but cannot include punctuation or spaces. The options argument specifies additional window state settings.
Center centers the form. Full creates a maximized window, excludes Hidden (full windows are always visible). Hidden opens invisible Client3D sets WS_EX_CLIENTEDGE Tool creates a WS_EX_TOOLWINDOW Help includes a Help button in the window caption, excludes minimize an maximize buttons Top creates a topmost window Palette creates a WS_EX_PALETTEWINDOW Fixed a non-sizable window
NoCaption no title bar NoTitle no title bar, alias Default uses Windows default values
The Form command can also be used to create MDI parent and child windows. Form [options] MdiParent form creates a parent MDI window (like ParentW). Form [options] MdiChild Parent form, name creates a MDI child window name of MDI parent form (like ChildW).
Form MdiParent test = , , 20 , 300 , 300 Form MdiChild Parent test, ch2 Form Hidden MdiChild Parent test, ch1 = "ChildW ch1", , , 10, 10 Do : Sleep : Until Me Is Nothing
An Ocx Form is control with all the attributes of a Form. An Ocx Form is used as a child form inside a parent form. Ocx Form is equivalent to VB's PictureBox.
Example
Form ftest = "GFA", 10, 10, 200, 300 // center it in the middle of the desktop ftest.Center 0 // OpenW 1, 10, 10, 300, 400 // if used for a windows with it's handle // Win_1.hWnd // test.Center Win_1.hWnd Do : Sleep : Until Me Is Nothing
Remarks
OpenW #n, ChildW #n, and ParentW #n are commands that create a Form, whose name is predestined by GFA-BASIC 32. These commands take a number n in the range from 0 to 31 to be identified by. These commands get the Form name Win_n, where n is the window number (Win_0 .. Win_31). A value greater than 31 will provide the window with the Form object name Form(n). The same is true for the Dialog command, which takes a number from 0 to 31 as well. The Form object for the dialog boxes is Dlg_0 .. Dlg_31.
For an example of ParentW, ChildW, and Ocx Form see ParentW.
|
|
|
Post by ventilo25 on Mar 14, 2013 15:03:25 GMT 1
Size is in twips
TwipsToPixelX, TwipsToPixelY Functions
Converts a horizontal Twips value into pixels.
Syntax
a# = TwipsToPixelX(b#) a# = TwipsToPixelY(b#) object: Form, Printer Ocx a, b: Double numeric expression
Description
With TwipsToPixelX, TwipsToPixelY a twips value can be converted to a pixel value. Himets (Himetric Units - the internal OLE- base coordinates unit) is 1/100 mm. 1 Twip (the base unit of GFA-BASIC 32 OLE) is 1/20 Point = 1 /1440 inch. The conversion factor between Twips and Himets are constants: n Twips = n * 2540/1440 Himets. The Screen property PixelsPerTwipX contains the conversion factor used for the function.
|
|
|
Post by bob82604 on Mar 15, 2013 12:55:16 GMT 1
My question is with the FORM EDITOR COMPONENT PROPERTIES window.
Do I understand correctly that the value in the height/width properties are in twips? If so what is the formula for MANUALLY (not programically) converting between twips and pixels?
The closest formula if have figured is: twips / 15 = pixels pixels * 15 = twips
Picking up my trusty calculator.... So a window that is 800X600 pixels would be 12000 X 9000 twips. I would then put in 9000 for the height and 12000 for the width.
Am I close?
|
|
|
Post by ventilo25 on Mar 15, 2013 15:56:04 GMT 1
Yes your formula is good. Watch the attached example. Regards Attachments:
|
|
|
Post by bob82604 on Mar 16, 2013 14:25:23 GMT 1
Thanks ;D
|
|