Jump to content

ToolBar


Recommended Posts

ToolBar Question

ToolBar why only shows two Chinese characters??? help me!!

#include <GuiToolbar.au3>
#include <GuiConstantsEx.au3>

Opt('MustDeclareVars', 1)

$Debug_TB = False; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hGUI, $hToolbar, $aStrings[4]
    Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp

  ; Create GUI
    $hGUI = GUICreate("Toolbar", 400, 300)
    $hToolbar = _GUICtrlToolbar_Create ($hGUI)
    GUISetState()

  ; Add standard system bitmaps
    _GUICtrlToolbar_AddBitmap ($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)

  ; Add strings
    $aStrings[0] = _GUICtrlToolbar_AddString ($hToolbar, "新建文件")
    $aStrings[1] = _GUICtrlToolbar_AddString ($hToolbar, "打开文件")
    $aStrings[2] = _GUICtrlToolbar_AddString ($hToolbar, "保存文件")
    $aStrings[3] = _GUICtrlToolbar_AddString ($hToolbar, "关于帮助")

  ; Add buttons
    _GUICtrlToolbar_AddButton ($hToolbar, $idNew, $STD_FILENEW, $aStrings[0])
    _GUICtrlToolbar_AddButton ($hToolbar, $idOpen, $STD_FILEOPEN, $aStrings[1])
    _GUICtrlToolbar_AddButton ($hToolbar, $idSave, $STD_FILESAVE, $aStrings[2])
    _GUICtrlToolbar_AddButtonSep ($hToolbar)
    _GUICtrlToolbar_AddButton ($hToolbar, $idHelp, $STD_HELP, $aStrings[3])

  ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

EndFunc ;==>_Main

Image:

post-32887-1204812806_thumb.jpg

Edited by yEn861220
Link to comment
Share on other sites

@yEn861220

At very least a free bump..

I'm running XP SP2+ without Chinese language support so I can only guess.

I think you need_GUICtrlToolbar_SetUnicodeFormat().

If you are using SciTe then check if you are using unicode

Menu > File > Encoding UTF?

I notice in v3.2.10.0 in SciTe using UTF-8 that two characters are shown in the code but three when code is run.

you may want to try beta v3.2.11.1

http://www.autoitscript.com/autoit3/files/beta/autoit/

maybe update SciTe as well

$aStrings[1] = _GUICtrlToolbar_AddString ($hToolbar, "Sö") ; I get a null character after 'S' (removed)

_GUICtrlToolbar_AddButton ($hToolbar, $idHelp, $STD_HELP, $aStrings[3])

_GUICtrlToolbar_SetUnicodeFormat($hToolbar, True)
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

I see fascists...

Link to comment
Share on other sites

Clarification, just got home from work, can view the forum from work can't post from work.

Thats odd, I can post here but not at like Gizmodo or Jalopnik through our BorderManager firewall.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...