Zeichensatz verwenden

  • Hallo,

    wie kann ich auf verschiedene Schriftarten
    zugreifen und diese kombinieren.
    (Guictrlsetfont....)
    aber wie macht man das?

    Mal ein kleines Beispiel

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Form2 = GUICreate("Form2", 405, 294, 265, 192)
    $txtinput = GUICtrlCreateInput("", 96, 72, 217, 21)
    $btnStart = GUICtrlCreateButton("Start", 96, 120, 219, 57, $WS_GROUP)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    Case $btnStart
    GUICtrlSetData($txtinput,"Juli")

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Die Schriftart wäre Wingdings (Taste1) ist der Ordner

    So sollte das aussehen
    autoit.de/wcf/attachment/16279/


    Grüße
    Ilse ;)

  • Hi,

    Edit: Ok, wer lesen kann, ist klar im Vorteil! (ist wohl noch zu früh für mein Hirn :))

    Wie man Schriftarten kombiniert, kann ich dir nicht sagen, schätze mal, dass das wieder irgendwie mit diesem speziellen "Edit" möglich sein sollte!
    (hab den Befehl grad nicht zur Hand, sorry!)

    Gruß
    x0r

    Simon nörgelt, Simon nervt - aber Simon verbessert die Welt. Glaubt er.

    Einmal editiert, zuletzt von x0r (31. August 2012 um 10:11)

  • Hallo,

    habe da irgendwo wieder ein Denkfehler

    anderes Beispiel:

    [autoit]


    $Text = "1"
    GUICtrlSetFont($Text 8, 400, 0, "Wingdings") ; 1 wird umgewandelt in Ordnersymbol
    MsgBox(0,"",$Text )

    [/autoit]

    Also man müsste das Zeichen 1 in die Schriftart Wingdings umwandeln, damit 1
    als Ordnersymbol rauskommt.


    ;) Grüße Ilse

  • du meinst sowas:

    [autoit]

    $Text = "1"
    $Edit1 = GUICtrlCreateEdit("", 16, 48, 345, 169)
    GUICtrlSetFont($Edit1 8, 400, 0, "Wingdings") ; 1 wird umgewandelt in Ordnersymbol
    GUICtrlSetData($Edit1,$Text)

    [/autoit]

    Simon nörgelt, Simon nervt - aber Simon verbessert die Welt. Glaubt er.

  • Hallo Xor,

    schau dir das mal bitte an:

    die 1 soll durch die Schriftart Wingdings ersetzt werden

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Form1", 459, 215, 192, 124)
    $ListView1 = GUICtrlCreateListView("Ordner|Monat", 24, 24, 250, 150)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
    $ListView1_0 = GUICtrlCreateListViewItem("1|Januar", $ListView1)
    $Button1 = GUICtrlCreateButton("Start", 280, 24, 75, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button1

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Da komm ich einfach nicht weiter....

    Liebe Grüße
    Ilse ;)

  • So was?

    Spoiler anzeigen
    [autoit]


    #include <FontConstants.au3>
    #include <WinAPI.au3>
    #include <GUIConstantsEx.au3>
    #include <ListViewConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $h_ListView_Font = _WinAPI_CreateFont(14, 0, 0, 0, 500, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $PROOF_QUALITY, 0, "Wingdings")
    $h_ListView_Font1 = _WinAPI_CreateFont(14, 0, 0, 0, 500, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $PROOF_QUALITY, 0, "Arial")

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Form1", 459, 215, 192, 124)
    $ListView1 = GUICtrlCreateListView("Ordner|Monat", 24, 24, 250, 150)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
    $ListView1_0 = GUICtrlCreateListViewItem("1|Januar", $ListView1)
    $Button1 = GUICtrlCreateButton("Start", 280, 24, 75, 25, $WS_GROUP)
    $hListView = GUICtrlGetHandle($ListView1)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
    _WinAPI_RedrawWindow($Form1)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIRegisterMsg($WM_NOTIFY, "")
    _WinAPI_DeleteObject($h_ListView_Font)
    _WinAPI_DeleteObject($h_ListView_Font1)
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button1

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg, $iwParam

    [/autoit] [autoit][/autoit] [autoit]

    Local $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    Local $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
    Local $nNotifyCode = DllStructGetData($tNMHDR, "Code")

    [/autoit] [autoit][/autoit] [autoit]

    Switch $hWndFrom
    Case $hListView
    Switch $nNotifyCode
    Case $NM_CUSTOMDRAW
    Local $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $ilParam)
    Local $iDrawStage = DllStructGetData($tCustDraw, "dwDrawStage")
    If $iDrawStage = $CDDS_PREPAINT Then Return $CDRF_NOTIFYITEMDRAW
    If $iDrawStage = $CDDS_ITEMPREPAINT Then Return $CDRF_NOTIFYSUBITEMDRAW
    Local $iItem = DllStructGetData($tCustDraw, "dwItemSpec")
    Local $hDC = DllStructGetData($tCustDraw, 'hdc')
    Local $iSubItem = DllStructGetData($tCustDraw, 'iSubItem')
    Switch Mod($iSubItem, 2)
    Case 0
    _WinAPI_SelectObject($hDC, $h_ListView_Font)
    Return $CDRF_NEWFONT
    Case 1
    _WinAPI_SelectObject($hDC, $h_ListView_Font1)
    Return $CDRF_NEWFONT
    EndSwitch
    Return $GUI_RUNDEFMSG
    EndSwitch
    EndSwitch
    EndFunc ;==>WM_NOTIFY

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯