Jump to content

Combobox Menüye Nesne Ekleme


oktay454
 Share

Recommended Posts


 

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Crysis 3", 212, 77, 192, 124)
$Group1 = GUICtrlCreateGroup("Language Select", 8, 8, 193, 57)
$Language = GUICtrlCreateCombo("Language", 16, 32, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("OK", 141, 30, 49, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


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


EndSwitch
WEnd
Selamün Aleyküm Arkadaşlar yukarıdaki GUI ekranını hazırladım ama pek beceremedim. Ben şimdi bu listeye türkçe ingilizce almanca falan ekleyip $Kur değişkenin içindeki $DilSec değişkenin yerine yazsın istiyorum. Mesela ben listeye Turkish diye seçtim ama $DilSec değişkenine tr_TR yazsın ve OK butonuna tıklayınca da $Kur değişkeni çalışsın. Olur mu böyle, bir yol gösterin lütfen.
 
Birde RunWait komutunda çalıştırılacak uygulamaya nasıl parametre eklerim.
 
Şimdiden teşekkürler. Allah(C.C.)'a emanet olun.
Link to comment
Share on other sites

Öncelikle dil seçeneğini daha mantıklı bir standartta oturtmanı öneririm. Parametre gönderme olayını da ShellExecute fonksiyonuyla halledebilirsin. Gelen parametreleri de $CmdLine ile kontrol ederbilirsin. Kolay gelsin.

 

Parametre Gönderme

 

ShellExecute("Programınİsmi.exe", "Parametre", "Çalışma Dosyası")

 

Gelen Parametreleri Kontrol Etme

 

For $i = 1 To $CmdLine[0]

 

MsgBox(0, $i, $CmdLine[$i])

 

Next

 

Dil konusunda ne yapmak istediğini tam olarak anlamadım. Ama:

 

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Crysis 3", 212, 77, 192, 124)
$Group1 = GUICtrlCreateGroup("Language Select", 8, 8, 193, 57)
$Language = GUICtrlCreateCombo("Dil", 16, 32, 121, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Türkçe|İngilizce|Kürtçe")
$Button1 = GUICtrlCreateButton("OK", 141, 30, 49, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

Global $GlobalVariable_Language = "TR"

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Language
			Switch GUICtrlRead($Language)
				Case "Türkçe"
					$GlobalVariable_Language = "TR"
				Case "İngilizce"
					$GlobalVariable_Language = "EN"
				Case "Kürtçe"
					$GlobalVariable_Language = "KR"
			EndSwitch
		MsgBox(0, "", $GlobalVariable_Language)

	EndSwitch
WEnd
Edited by asmazh
Link to comment
Share on other sites

Öncelikle dil seçeneğini daha mantıklı bir standartta oturtmanı öneririm. Parametre gönderme olayını da ShellExecute fonksiyonuyla halledebilirsin. Gelen parametreleri de $CmdLine ile kontrol ederbilirsin. Kolay gelsin.

 

Parametre Gönderme

 

ShellExecute("Programınİsmi.exe", "Parametre", "Çalışma Dosyası")

 

Gelen Parametreleri Kontrol Etme

 

For $i = 1 To $CmdLine[0]

 

MsgBox(0, $i, $CmdLine[$i])

 

Next

 

Dil konusunda ne yapmak istediğini tam olarak anlamadım. Ama:

 

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Crysis 3", 212, 77, 192, 124)
$Group1 = GUICtrlCreateGroup("Language Select", 8, 8, 193, 57)
$Language = GUICtrlCreateCombo("Dil", 16, 32, 121, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Türkçe|İngilizce|Kürtçe")
$Button1 = GUICtrlCreateButton("OK", 141, 30, 49, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

Global $GlobalVariable_Language = "TR"

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Language
			Switch GUICtrlRead($Language)
				Case "Türkçe"
					$GlobalVariable_Language = "TR"
				Case "İngilizce"
					$GlobalVariable_Language = "EN"
				Case "Kürtçe"
					$GlobalVariable_Language = "KR"
			EndSwitch
		MsgBox(0, "", $GlobalVariable_Language)

	EndSwitch
WEnd

Bu mesajı yazdıktan sonra biraz kurcalayınca ShellExecute parametresini buldum. 

 

ShellExecuteWait(@ScriptDir&"\__Installer\Touchup.exe", "install -locale tr_TR -installPath "&@ScriptDir&" -autologging -startmenuIcon=1 -desktopIcon=1")

 

Mesela kırmızı olarak belirttiğim tr_TR'yi menüden ingilizceyi seçince en_US olsun yada almancayı seçince de_DE olsun istiyorum. OK butonuna basınca da yukarıdaki ShellExecuteWait komutunu uygulasın. Bunu nasıl yapabilirim. Crysis 3 oyununu kendi arşivime atıcam fakat mevcut kurulum paketi hoşuma gitmedi. Kolay kurulumlu yapıcam ama AutoIt'i pek bilmiyorum. Kendi yaptığım GUI ise Koda FormDesigner'da yapmaya çalışmıştım.

Link to comment
Share on other sites


#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Crysis 3", 212, 77, 192, 124)
$Group1 = GUICtrlCreateGroup("Dil Seç", 8, 8, 193, 57)
$Language = GUICtrlCreateCombo("Dil", 16, 32, 121, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Türkçe|İngilizce|Almanca")
$Button1 = GUICtrlCreateButton("OK", 141, 30, 49, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
 
Global $GlobalVariable_Language = "TR"
 
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Language
Switch GUICtrlRead($Language)
Case "Türkçe"
$Dil = "Türkçe"
$GlobalVariable_Language = "tr_TR"
Case "İngilizce"
$Dil = "İngilizce"
$GlobalVariable_Language = "en_US"
Case "Almanca"
$Dil = "Almanca"
$GlobalVariable_Language = "de_DE"
EndSwitch
MsgBox(0,"Crysis 3 Kurulum", $Dil&" olarak yükleniyor...")
ShellExecuteWait(@ScriptDir&"\__Installer\Touchup.exe", "install -locale "&$GlobalVariable_Language&" -installPath "&@ScriptDir&" -autologging -startmenuIcon=1 -desktopIcon=1")
MsgBox(0,"Crysis 3 Kurulum", $Dil&" olarak yüklendi.")
EndSwitch
WEnd

Kodu böyle değiştirdim. Fakat dili seçtiğimde direk komutu uyguluyor. OK'a bastığımda nasıl uygulatabilirim.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...