Jump to content
Sign in to follow this  
E1M1

Why my script don't change font for $edit3

Recommended Posts

E1M1

Hello, I am trying to make simple notepad, But the problem is when I create new tab with ctrl + t then $edit3 on next tab wont get right font. $Edit3 should have same font as $edit1, but it don't.How I could fix it?

I Also figured out that if I remove following 3 lines from my script, I won't have that problem.

$Format = GUICtrlCreateMenu("F&ormat")
$Font = GUICtrlCreateMenuItem("&Font...", $Format)
$MenuColor = GUICtrlCreateMenuItem("&Color...", $Format)oÝ÷ ØÆ¢Ç+ZºÚ"µÍÚ[ÛYH    ÑY]ÛÛÝ[Ë]LÉÝÂÚ[ÛYH    ÑÝZUX]LÉÝÂÚ[ÛYH  ÑÕRPÛÛÝ[Ñ^]LÉÝÂÚ[ÛYH ÔÝ]XÐÛÛÝ[Ë]LÉÝÂÚ[ÛYH    ÕÚ[ÝÜÐÛÛÝ[Ë]LÉÝÂÚ[ÛYH ÑÝZQY]]LÉÝÂÌÍÝXÜX]YHÌÍÑÛÚ^HH  ][ÝÉY ][ÝÂÌÍÑÛH ][ÝÉY ][ÝÂÌÍÐÛÛÜH ][ÝÉY ][ÝÂÌÍÐÐÛÛÜH   ][ÝÉY ][ÝÂÌÍÑÜLHHÕRPÜX]J  ][ÝÕ[]YHÝY   ][ÝË

LMMÑLL
BÌÍÚXHÑÕRPÝXÐÜX]J   ÌÍÑÜLK
BÑÕRPÝXÒ[Ù][J  ÌÍÚX ][ÝÕ[]Y   ][ÝÊBÌÍÑY]HHÕRPÝÜX]QY]
    ][ÝÉ][ÝË



K
LÌÌLPÍ
BÑY][Ù
    ÌÍÑY]JBÌÍÑÜX]HÕRPÝÜX]SY[J ][ÝÑ[ÛÜX]   ][ÝÊBÌÍÑÛHÕRPÝÜX]SY[R][J   ][ÝÉ[ÑÛ][ÝË   ÌÍÑÜX]
BÌÍÓY[PÛÛÜHÕRPÝÜX]SY[R][J  ][ÝÉ[ÐÛÛÜ][ÝË   ÌÍÑÜX]
BÌÍÛZÝXHÕRPÝÜX]P]Û  ][ÝÉ][ÝËKJB[H   ÌÍÑÜLWÐXØÙ[XVÌWVÌHHÖÉ][Ý×  ][ÝË  ÌÍÛZÝXWBÕRTÙ]XØÙ[]ÜÊ  ÌÍÑÜLWÐXØÙ[XJBÚ[HBQÕRTYÚÝÙÊ    ÌÍÕÓWÓÕQK ][ÝÕÓWÓÕQI][ÝÊBIÌÍÛÙÈHÕRQÙ]ÙÊ
BTÝÚ]Ú   ÌÍÛÙÂBPØÙH   ÌÍÛZÝXBBPÛÛÛÛÛ[X[
    ÌÍÑÜLK  ][ÝÉ][ÝË    ÌÍÚX ][ÝÕXYÚ  ][ÝË  ][ÝÉ][ÝÊBBBWÑÕRPÝXÒ[Ù][J   ÌÍÚXÑÕRPÝXÑÙ]][PÛÝ[
    ÌÍÚXH
ÈK ][ÝÉ[É][ÝÈ [ÈÑÕRPÝXÑÙ]][PÛÝ[
    ÌÍÚXH
ÈH [È ][ÝÕ[]Y   ][ÝÊBBBIÌÍÜÜÈHÛÛÛÙ]ÜÊ  ÌÍÑÜLK  ][ÝÉ][ÝË    ÌÍÑY]JBBBRY  ÌÍÝXÜX]YH[BBBQÕRPÝÙ]ÜÊ ÌÍÑY]K   ÌÍÜÜÖÌK   ÌÍÜÜÖÌ×HHBBBBIÌÍÜÜÈHÚ[Ù]ÛY[Ú^J  ÌÍÑÜLJBBBBPÛÛÛ[ÝJ   ][ÝÉ][ÝË    ][ÝÉ][ÝË    ÌÍÚX ÌÍÜÜÖÌKJBBBBIÌÍÝXÜX]YHBBBQ[YBBIÌÍÙY]ÈHÕRPÝÜX]QY]
    ][ÝÉ][ÝË



K
LÌÌLPÍ
BBBWÑY][Ù
    ÌÍÙY]ÊBBBQÕRPÝÙ]ÝÛÜ   ÌÍÙY]Ë
JBBBQÕRPÝÙ]Ú^[Ê    ÌÍÙY]Ë  ÌÍÑÕRWÑÐÒÓQ
È  ÌÍÑÕRWÑÐÒÔQÒ
È  ÌÍÑÕRWÑÐÒÕÔ
È  ÌÍÑÕRWÑÐÒÐÕÓJBBBIÌÍÜÜÈHÛÛÛÙ]ÜÊ ÌÍÑÜLK  ][ÝÉ][ÝË    ÌÍÑY]JBBBQÕRPÝÙ]ÜÊ  ÌÍÙY]Ë  ÌÍÜÜÖÌK   ÌÍÜÜÖÌ×JBQ[ÝÚ]ÚÑ[[ÈÑY][Ù
    ÌÍÚÛ
BRYÝ[Ò[Ý ÌÍÑÛÚ^K    ][ÝÉY ][ÝÊH[BIÌÍÑÛÚ^HH ][ÝÌ  ][ÝÂQ[YRYÝ[Ò[Ý ÌÍÑÛ    ][ÝÉY ][ÝÊH[BIÌÍÑÛH ][ÝÓXÚYHÛÛÛÛI][ÝÂQ[YQÕRPÝÙ]Û
    ÌÍÚÛ    ÌÍÑÛÚ^K    ÌÍÑÛ
BRY ÌÍÐÛÛÜ    ÉÝÈ  ][ÝÉY ][ÝÈ[BQÕRPÝÙ]ÛÛÜ    ÌÍÚÛ    ÌÍÐÛÛÜBQ[YRY  ÌÍÐÐÛÛÜ  ÉÝÈ  ][ÝÉY ][ÝÈ[BQÕRPÝÙ]ÐÛÛÜ  ÌÍÚÛ    ÌÍÐÐÛÛÜBQ[Y[[ÈÏOIÝ×ÑY][Ù[ÈÓWÓÕQJ   ÌÍÚÛ    ÌÍÓÙË  ÌÍÝÔ[K  ÌÍÛ[JBSØØ[ ÌÍÚÛX   ÌÍÝR ÌÍÒÛÛK ÌÍÚPÛÙBIÌÍÚÛXH ÌÍÚXRYÝÒÛ
    ÌÍÚÛXH[ ÌÍÚÛXHÕRPÝÙ][J   ÌÍÚXBIÌÍÝRHÝXÝÜX]J ÌÍÝYÓR  ÌÍÛ[JBIÌÍÒÛÛHHÛ
ÝXÝÙ]]J  ÌÍÝR ][ÝÚÛÛI][ÝÊJBIÌÍÚPÛÙHHÝXÝÙ]]J ÌÍÝR ][ÝÐÛÙI][ÝÊBTÝÚ]Ú  ÌÍÒÛÛBBPØÙH  ÌÍÚÛXBBTÝÚ]Ú ÌÍÚPÛÙBBBBPØÙH   ÌÍÕÓÔÑSÒSÑBBBBBTÝÚ]ÚÑÕRPÝXÑÙ]ÝÙ[
    ÌÍÚXBBBBBBPØÙHBBBBBBQÕRPÝÙ]Ý]J ÌÍÙY]Ë  ÌÍÑÕRWÒQJBBBBBBBQÕRPÝÙ]Ý]J ÌÍÑY]K   ÌÍÑÕRWÔÒÕÊBBBBBBPØÙHBBBBBBBQÕRPÝÙ]Ý]J ÌÍÑY]K   ÌÍÑÕRWÒQJBBBBBBBQÕRPÝÙ]Ý]J ÌÍÙY]Ë  ÌÍÑÕRWÔÒÕÊBBBBBBPØÙHÈXBBBBBPØÙHÎÈÝXBBBBQ[ÝÚ]ÚBBQ[ÝÚ]ÚQ[ÝÚ]ÚT]  ÌÍÑÕRWÔSQTÑÂ[[ÈÏOIÝÕÓWÓÕQ

edited

Share this post


Link to post
Share on other sites
GodlessSinner

1st:

#Include <Misc.au3>

2d:

$Global, $selectedfont

inside While write this:

Case $Font
        $selectedfont  = _ChooseFont()
        If $selectedfont <> -1 Then
            GUICtrlSetFont($Edit1, $selectedfont[3])
        EndIf

- it will change a font size in your edit, for more, please, read AutoitHelpFile in GUICtrlSetFont and Function_ChooseFont


_____________________________________________________________________________

Share this post


Link to post
Share on other sites
GodlessSinner

And your script not creates a Tab item correctly.


_____________________________________________________________________________

Share this post


Link to post
Share on other sites
E1M1

how would you create tab then?


edited

Share this post


Link to post
Share on other sites
E1M1

Vitas, I want Use my own function to auto set font, i don't choose it manually every time.

This is that func

Func _EditMod($hWnd)
    If StringInStr($FontSize, "%d") Then
        $FontSize = "20"
    EndIf
    If StringInStr($Font, "%d") Then
        $Font = "Lucida Console"
    EndIf
    GUICtrlSetFont($hWnd, $FontSize, 0, 0, $Font)
    If $Color <> "%d" Then
        GUICtrlSetColor($hWnd, $Color)
    EndIf
    If $BGColor <> "%d" Then
        GUICtrlSetBkColor($hWnd, $BGColor)
    EndIf
EndFunc ;==>_EditMod

Why my script works if I remove these 3 lines?

$Format = GUICtrlCreateMenu("F&ormat")

$Font = GUICtrlCreateMenuItem("&Font...", $Format)

$MenuColor = GUICtrlCreateMenuItem("&Color...", $Format)

Edited by E1M1

edited

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.