English
Source / code snippets

report Control Edit Vertikal Centered

 
Stephan Sonneborn (01.03.11)

Hello together,

I The Presentation Thomas yet something complement...
CompileMarkSeparation
'************************************************************************************************
'* Vertikal zentriertes Editfeld                                              Built: 01.03.2011 *
'* optional links, rechts oder mittig ausgerichtet (ggf. nur Zahlen erlaubt)                    *
'* nach einer Vorlage von Thomas Freier                                                         *
'* erweitert durch Stephan Sonneborn                                                            *
'************************************************************************************************
DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
'+----------------------------------------------------------------------------------------------+
DECLARE Font&, Edit&, THeight%
DECLARE LastDlgID&
'+----------------------------------------------------------------------------------------------+
'************************************************************************************************
'* Einzel-IDs für Dialogelemete generieren                                                      *
'************************************************************************************************

PROC NewID

    DECLARE ID&
    '+----------------------------------------------------------------------------------------------+
    LastDlgID& = LastDlgID& + 1
    ID& = LastDlgID&
    '+----------------------------------------------------------------------------------------------+
    RETURN ID&
    '+----------------------------------------------------------------------------------------------+

ENDPROC

'************************************************************************************************
'************************************************************************************************
'* Vertikal zentriertes Editfeld                                                                *
'************************************************************************************************

PROC CreateEditVert

    PARAMETERS hParent&, Text$, x1%, y1%, dx%, dy%, TSize%, Alignment%, Number%
    'hParent   : Handle des Elterfensters
    'Text$     : Vorgabetext
    'x1%, y1%  : linke obere Ecke des "Editfeldes"
    'dx%, dy%  : Größe des "Editfeldes"
    'TSize%    : Texthöhe im Editfeld
    'Alignment%: 0 => links, 1 => mittig, 2 => rechts ausgerichtet
    ' Number%  : <> 0 => nur Zahleneingabe erlaubt
    DECLARE hStatic&, hEdit&
    DECLARE EHeight%, Style&
    '+----------------------------------------------------------------------------------------------+
    EHeight% = TSize% + 6
    Style&   = $50000080 + Alignment%
    Case Number%: Style& = Style& + $2000
    hStatic& = CONTROL("Static",""   ,$54001106             ,x1%,y1%,dx%,dy%,hParent&,NEWID(),0)
    hEdit&   = CONTROL("Edit"  ,Text$, Style&,  0,  0,  0,  0,hStatic&,NewID(),0)
    SETWINDOWPOS hEdit& = 0, ((dy%-TSize%)/2) - dx%, EHeight%; 0
    '+----------------------------------------------------------------------------------------------+
    RETURN hEdit&
    '+----------------------------------------------------------------------------------------------+

ENDPROC

'************************************************************************************************
'************************************************************************************************
SET("TRUECOLOR",1)
CLS GETSYSCOLOR(15)
'+----------------------------------------------------------------------------------------------+
THeight% = 30
Font&    = CREATEFONT    ("Arial",THeight%,0,0,0,0)
Edit&    = CreateEditVert(%HWND, "",10,50,300,80,THeight%,1, 0)'Texteingabe
'Edit&    = CreateEditVert(%HWND, "",10,50,300,80,THeight%,1, 1) 'Zahleneingabe
SETFONT Edit&, Font&
SETTEXT Edit&,"Bitte hier Text eingeben"
'+----------------------------------------------------------------------------------------------+
LOCATE 1,1
PRINT "Weiter mit F1"
'+----------------------------------------------------------------------------------------------+

WHILE 1

    WAITINPUT
    CASE %KEY = 5: BREAK

WEND

'+----------------------------------------------------------------------------------------------+
PRINT "Text im Editfeld: ", GETTEXT$(Edit&)
PRINT "Ende mit Mausklick."
'+----------------------------------------------------------------------------------------------+
WAITINPUT
'+----------------------------------------------------------------------------------------------+
DELETEOBJECT Font&
END
'***************
***************************************************************************

 
03/01/11  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.173 Views

Untitledvor 0 min.
RudiB.05/28/21
ByteAttack02/11/20
Matzbub12/29/18
Christof Neuß09/18/18
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie