Verfasst: 05.02.2005 10:06
@DarkDragon
Kannste bei vielen Screencapture Programmen einstellen
Kannste bei vielen Screencapture Programmen einstellen
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Ich dachte eher an eine art Tastenkombination mit der Druck/S-Abf Taste.ts-soft hat geschrieben:@DarkDragon
Kannste bei vielen Screencapture Programmen einstellen
Wie bereits schon richtig vermutet wurde: ich habe Irfanview genommen mit der entsprechenden Option "Mauszeiger mit fotografieren".DarkDragon hat geschrieben:[OffTopic=Sorry]Andre, wie hast du den Mauszeiger ins Bild bekommen?[/OffTopic]
Code: Alles auswählen
Enumeration
#MainWindow
#AuthorWin
#AuthorWinFrame
#AuthorWinText
#AuthorWinCombo
#AuthorWinQuit
#AuthorWinExit
#AuthorWinChoose
#SearchAuthorSelect
EndEnumeration
Global author_changed.l
Procedure.l callback(hwnd.l, Message.l, wParam.l, lParam.l)
DefType.l result
DefType.l control_id
DefType.l notification
result = #PB_ProcessPureBasicEvents
If IsWindow(#AuthorWin) And hwnd = WindowID(#AuthorWin)
If Message=#WM_COMMAND
notification = (wParam >> 16) & $FFFF
control_id = wParam & $FFFF
If control_id = #AuthorWinCombo
If notification = #CBN_CLOSEUP
state = GetGadgetState(#AuthorWinCombo)
;Debug "Callback selected item "+GetGadgetText(#AuthorWinCombo)+" "+Str(state)
If state>=0
author_changed = 1
EndIf
EndIf
EndIf
EndIf
EndIf
ProcedureReturn result
EndProcedure
;- Authors-Window
Procedure OpenAuthors()
; Opens a new window for choosing authors
; nearby the mouse cursor
If OpenWindow(#AuthorWin,0,0,190,104,#PB_Window_BorderLess|#PB_Window_Invisible,"",WindowID(#MainWindow))
SetWindowCallback(@callback())
If CreateGadgetList(WindowID())
x = 8 : y = 28 : w = 174
Frame3DGadget (#AuthorWinFrame, 3,3,184,98,"Choose author") ; Title: Choose author to search:
TextGadget (#AuthorWinText, x,y,w,20,"Authors",#PB_Text_Center) : y + 16 ; Authors
AdvancedGadgetEvents(#TRUE)
ComboBoxGadget(#AuthorWinCombo,x,y,w,400) : y + 26
For a=1 To 100
AddGadgetItem(#AuthorWinCombo,-1,"Test "+Str(a))
Next
AdvancedGadgetEvents(#FALSE)
ButtonGadget (#AuthorWinQuit, x,y,w,24,"Cancel") ; Cancel (after choosing a keyword the window will be automatically closed)
EndIf
AddKeyboardShortcut(#AuthorWin,#PB_Shortcut_Escape,#AuthorWinExit)
AddKeyboardShortcut(#AuthorWin,#PB_Shortcut_Return, #AuthorWinChoose)
ActivateGadget(#AuthorWinCombo)
EndIf
EndProcedure
Procedure ShowAuthors()
SetGadgetState(#AuthorWinCombo,-1)
UseWindow(#AuthorWin)
MoveWindow(DesktopMouseX(),DesktopMouseY())
HideWindow(#AuthorWin,0)
SetWindowPos_(WindowID(#AuthorWin),#HWND_TOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)
EnableWindow_(WindowID(#MainWindow), #False)
EndProcedure
Procedure HideAuthors()
EnableWindow_(WindowID(#MainWindow), #True)
HideWindow(#AuthorWin,1)
EndProcedure
Flags.l = #PB_Window_SystemMenu|#PB_Window_TitleBar
MainWin = OpenWindow(#MainWindow, 100, 100, 200, 100, Flags, "Test")
If MainWin
If CreateGadgetList(WindowID())
ButtonGadget(#SearchAuthorSelect, 50, 50, 20, 20, "...")
EndIf
EndIf
OpenAuthors()
run = #True
Repeat
author_changed = 0
Event = WaitWindowEvent()
WindowID = EventWindowID()
GadgetID = EventGadgetID()
MenuID = EventMenuID()
EvTypeID = EventType()
;- Events MainWin
If WindowID = #MainWindow
;- MainWin ExitEvent
If Event = #PB_EventCloseWindow
run = #False
ElseIf Event = #PB_EventGadget
If GadgetID = #SearchAuthorSelect
ShowAuthors()
EndIf
EndIf
;- Events Authors
ElseIf WindowID = #AuthorWin
If Event = #PB_EventGadget
If GadgetID = #AuthorWinQuit
HideAuthors()
ElseIf GadgetID = #AuthorWinCombo ; Author choosen
If author_changed
Debug "Selected item: " + GetGadgetText(#AuthorWinCombo)+" "+Str(GetGadgetState(#AuthorWinCombo))
HideAuthors()
EndIf
EndIf
EndIf
Select MenuID
Case #AuthorWinExit
Debug "cancelled author list"
HideAuthors()
Case #AuthorWinChoose
Debug "Return selected item: " + GetGadgetText(#AuthorWinCombo)+" "+Str(GetGadgetState(#AuthorWinCombo))
HideAuthors()
EndSelect
EndIf
Until run = #False
versuche es mal damitAndre hat geschrieben:... Hat jedoch einen kleinen Haken: bei Tastaturbedienung wird jetzt bereits beim Scrollen mit den Cursortasten ein Element ausgewählt.
Code: Alles auswählen
; ********** Abfrage der Auswahlliste **********
If event2 = 1 Or event2 = 13 ; LeftMouseButton or RETURN pressed
maus1=1
EndIf
If event2=0 And maus1=1
maus1=0
a = GetGadgetState(#AuthorWinCombo)
If a > 0
Debug "Selected item: " + GetGadgetText(#AuthorWinCombo)
HideAuthors()
EndIf
EndIf
; ********************************************** ja hast recht, aber ein anderer "Fehler" wurde damit behoben.Andre hat geschrieben:@Donald: nützt leider nichts, damit tritt wieder das ursprüngliche Problem auf, dass bei einem Klick auf den Scrollbalken trotzdem ein Eintrag ausgewählt wird.