Kod:
int LoadFont(filename)
load the font in your system
filename- path
return value- identifier font (used in the method RemoveFont to remove the font from the system), IF = 0 font will not be removed and will hang in the system until the next reboot.
DO NOT use the fonts with the internal names at the system
Sample:
txtfield.LoadFont(u'e:\\myfont.gdr')
####################
RemoveFont(id) unload the font from the system
####################
ShadowVector(x,y) to install the vector of shadow
Sample:
txtfield.ShadowVector(-1,3)
####################
object New((rect) [,strlimit=0, txtlimit=0, cornertype= ECornerSquare, cornerflag=None, editorflag=None, picalign=EPicBaseLine])
----
rect-(x1, y1, x2, y2) coordinates of the window x1 и y1 - upper-left, x2 и y2 - lower-right
----
strlimit- allowable number of rows, the default is not limited
----
txtlimit- maximum number of characters, default is not limited
----
cornertype- rounded corners, allowable values:
ECornerSquare
ECorner1
ECorner2
ECorner5
----
cornerflag- some corners are not rounded
ENotTL- upper-left
ENotTR- upper-right
ENotBL- lower-left
ENotBR- lower-right
----
editorflag:
EDisplayOnly- not responding
EAlwaysShowSelection- by changing the focus selection is not removed
EReadOnly- read only
ENoLineBreaks- not allow a line break
EDisableCursor- hide cursor
----
picalign- alignment of images on the text:
EPicBaseLine- through text
EPicBottom- on bottom
EPicCentered- center
EPicTop- on top
>>Sample:
txt=txtfield.New((20,120,156,200),cornertype= txtfield.ECorner2, cornerflag= txtfield.ENotTL | txtfield.ENotBR, editorflag= txtfield.EAlwaysShowSelection | txtfield.EReadOnly)
>>Minimum configuration:
txt=txtfield.New((20,120,156,200))
=========methods==========
move(MovementType [,pix=20]) moving text
MovementType
----
EFLeft- left to right
----
EFRight- right to left
----
EFLineUp- text line down
----
EFLineDown- text to line up
----
EFPageUp- page top
----
EFPageDown- page down
(int)pix- optional parameter indicates how many pixels to move the text with horizontal scrolling
==========================
align(Alignment) text alignment
Alignment:
----
ELeftAlign- the left edge
----
ETopAlign- по верху
----
ECenterAlign- center
----
ERightAlign- the right edge
----
EBottomAlign- по низу
----
EJustifiedAlign
----
EUnspecifiedAlign- without alignment
==========================
setpos(x,y) establish a new position of the window
==========================
setsize(x,y) install the new window size
==========================
setcursor(pos) set the cursor in the position
==========================
clear([pos,len]) clear the text from the position-pos length-len, with no parameters removes all text
==========================
add(text [,select=0]) add text to the current cursor position, select- flag on the text selection, if select=1 inserted text is highlighted
==========================
unicode get() get the text
==========================
font(fontname [,fontsize]) set the font(fontname) size of fontsize
==========================
txtcolor(color) set the text color in hex format
==========================
bgcolor(color) set background color in hex format
==========================
visible(True or False) show-hide window
==========================
focus(True or False) off-set the focus window
==========================
setimg(img, pos, (x,y)) load picture img(object graphics.Image.open) the position-pos size of (x,y)
==========================
shadow(size) add a shadow to the window in the size
==========================
select(start,end) highlight text: start-start of a selection of 0-position, end- end of selection of the 0-position
==========================
clipboard(True or False) if True- paste, if False- copied to the clipboard the selected text
==========================
((len,position,isfocus,piccount,wordcount)) info()
return:
len- text length
position- current cursor position
isfocus- True-if the window is in focus or False-if no
piccount- number of images
wordcount- number of words
Bu Konuyu Paylaşın !