Jump to content

Bu Şekil Bir Tema..!


asmazh
 Share

Recommended Posts

Merhabalar Arkadaşlar,

@BlueLife nin verdiği kodlar sayesinde böyle bir tema yaptım fakat program sürekli else leri kayde alıyor ve program titreşime giriyor.

verdiğim bu programda belirttiğim tema başka bir yolla nasıl yapılır lütfen yardım edin şimdiden sağolun.

[codebox]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Tema Deneme", 275, 299, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 24, 272, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Button2", 120, 272, 75, 25, $WS_GROUP)
$Input1 = GUICtrlCreateInput("Input1", 8, 24, 121, 21)
$Input2 = GUICtrlCreateInput("Input2", 8, 56, 121, 21)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 88, 97, 17)
$Radio1 = GUICtrlCreateRadio("Radio1", 8, 120, 113, 17)
$Radio2 = GUICtrlCreateRadio("Radio2", 8, 152, 113, 17)
$List1 = GUICtrlCreateList("", 160, 16, 97, 123)
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit




EndSwitch
$GG_CINFO = GUIGetCursorInfo()
;If WinActive($Form1) Then -- Yaptığımda Program Aşırı Derecede Ağırlaşıyor...
; Forumdada belittiğim üzere program sürekli titreşim halinde yani BU ELSE ler durmadan titreşim halinde
; bu Titreşim olmadan bu şekil bir tema nasıl yapılır ???????
If $GG_CINFO[4] = $Button1 Then
GUICtrlSetData($Button1, "Mouse Üstünde")
Else
GUICtrlSetData($Button1, "Button1")
EndIf
If $GG_CINFO[4] = $Button2 Then
GUICtrlSetData($Button2, "Mouse Üstünde")
Else
GUICtrlSetData($Button2, "Button2")
EndIf
If $GG_CINFO[4] = $List1 Then
GUICtrlSetBkColor($List1, 0x000000)
Else
GUICtrlSetBkColor($List1, 0xFFFFFF)
EndIf
If $GG_CINFO[4] = $Input1 Then
GUICtrlSetBkColor($Input1, 0x000000)
Else
GUICtrlSetBkColor($Input1, 0xFFFFFF)
EndIf
If $GG_CINFO[4] = $Input2 Then
GUICtrlSetBkColor($Input2, 0x000000)
Else
GUICtrlSetBkColor($Input2, 0xFFFFFF)
EndIf
If $GG_CINFO[4] = $Checkbox1 Then
GUICtrlSetBkColor($Checkbox1, 0x000000)
Else
GUICtrlSetBkColor($Checkbox1, 0xFFFFFF)
EndIf
If $GG_CINFO[4] = $Radio1 Then
GUICtrlSetBkColor($Radio1, 0x000000)
Else
GUICtrlSetBkColor($Radio1, 0xFFFFFF)
EndIf
If $GG_CINFO[4] = $Radio2 Then
GUICtrlSetBkColor($Radio2, 0x000000)
Else
GUICtrlSetBkColor($Radio2, 0xFFFFFF)
EndIf
WEnd[/codebox] Edited by KintaRo
uzun kodlarda code yerine codebox tagı
Link to comment
Share on other sites

@asmazh

Bir çok farklı farklı şekilde yapılabilir. Basit bir örnek verelim!
Bu arada GUIGetCursorInfo() için ekranın aktif olması gerekiyordu!
Neyse;

[codebox]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Tema Deneme", 275, 299, 192, 124)
GUISetOnEvent(-3, "_Exit")
$Button1 = GUICtrlCreateButton("_Button1", 24, 272, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "_Button1")
$Button2 = GUICtrlCreateButton("Button2", 120, 272, 75, 25, $WS_GROUP)
$Input1 = GUICtrlCreateInput("Input1", 8, 24, 121, 21)
$Input2 = GUICtrlCreateInput("Input2", 8, 56, 121, 21)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 88, 97, 17)
$Radio1 = GUICtrlCreateRadio("Radio1", 8, 120, 113, 17)
$Radio2 = GUICtrlCreateRadio("Radio2", 8, 152, 113, 17)
$List1 = GUICtrlCreateList("", 160, 16, 97, 123)
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8")
GUISetState(@SW_SHOW)

Local $Focus
While 1
$GG_CINFO = GUIGetCursorInfo()
If IsArray($GG_CINFO) Then
Switch $GG_CINFO[4]
Case $Button1
If $Focus <> $Button1 Then
_UnFocus($Focus)
GUICtrlSetData($Button1, "Mouse Üstünde")
EndIf
$Focus = $Button1

Case $Button2
If $Focus <> $Button2 Then
_UnFocus($Focus)
GUICtrlSetData($Button2, "Mouse Üstünde")
EndIf
$Focus = $Button2

Case $List1
If $Focus <> $List1 Then
_UnFocus($Focus)
GUICtrlSetBkColor($List1, 0x000000)
EndIf
$Focus = $List1
Case Else
$Focus = _UnFocus($Focus)
EndSwitch

EndIf
Sleep(100) ;CPU Save
WEnd

Func _UnFocus($GUI_ID)
Switch $GUI_ID
Case $Button1
GUICtrlSetData($Button1, "Button1")
Case $Button2
GUICtrlSetData($Button2, "Button2")

Case $List1
GUICtrlSetBkColor($List1, 0xFFFFFF)
EndSwitch
Return ""
EndFunc

Func _Exit()
Exit
EndFunc ;==>_Exit

Func _Button1()
MsgBox(64, "", "Button1")
EndFunc ;==>_Button1[/codebox]

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...