ScintillaGadget: Drag and Drop?

Für allgemeine Fragen zur Programmierung mit PureBasic.
Benutzeravatar
Kiffi
Beiträge: 10725
Registriert: 08.09.2004 08:21
Wohnort: Amphibios 9

ScintillaGadget: Drag and Drop?

Beitrag von Kiffi »

Hallo,

lt. Dokumentation unterstützt das ScintillaGadget momentan kein Drag & Drop:
The following events are supported through EventType():
#PB_EventType_RightClick
Demnach funktioniert folgender Code auch nicht wie gewünscht:

Code: Alles auswählen

#Window = 0
#Scintilla = 0

If OpenWindow(#Window, 0, 0, 320, 90, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	EnableWindowDrop(#Window, #PB_Drop_Files, #PB_Drag_Copy)
	If InitScintilla()
		ScintillaGadget(#Scintilla, 10, 10, 300, 70, 0)
		EnableGadgetDrop(#Scintilla, #PB_Drop_Files, #PB_Drag_Copy)
		Repeat 
			WWE = WaitWindowEvent()
			Select WWE
				Case #PB_Event_Gadget
					Select EventGadget()
						Case #Scintilla
							Select EventType()
								Case #PB_EventType_DragStart
									Debug "#PB_EventType_DragStart"
							EndSelect
					EndSelect
			EndSelect
		Until WWE = #PB_Event_CloseWindow
	EndIf
EndIf
Gibt es dennoch eine Möglichkeit, D&D für das Gadget zu realisieren?

Danke im voraus & Grüße ... Kiffi
a²+b²=mc²
Benutzeravatar
edel
Beiträge: 3667
Registriert: 28.07.2005 12:39
Computerausstattung: GameBoy
Kontaktdaten:

Re: ScintillaGadget: Drag and Drop?

Beitrag von edel »

Was genau sollte der Code denn machen? Einfach eine Datei auf das Fenster ziehen und fertig?
Benutzeravatar
Kiffi
Beiträge: 10725
Registriert: 08.09.2004 08:21
Wohnort: Amphibios 9

Re: ScintillaGadget: Drag and Drop?

Beitrag von Kiffi »

edel hat geschrieben:Was genau sollte der Code denn machen? Einfach eine Datei auf das Fenster ziehen und fertig?
japp. Ich möchte gerne mitbekommen, dass eine Datei auf das Gadget gedroppt wurde, damit ich sie dann laden kann.

Grüße ... Kiffi
a²+b²=mc²
Benutzeravatar
edel
Beiträge: 3667
Registriert: 28.07.2005 12:39
Computerausstattung: GameBoy
Kontaktdaten:

Re: ScintillaGadget: Drag and Drop?

Beitrag von edel »

Code: Alles auswählen

#Window = 0
#Scintilla = 0


If OpenWindow(#Window, 0, 0, 320, 90, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  
  If InitScintilla()
    ScintillaGadget(#Scintilla, 10, 10, 300, 70, 0)
    EnableGadgetDrop(#Scintilla, #PB_Drop_Files, #PB_Drag_Copy)
    
    Repeat 
      WWE = WaitWindowEvent()
      Select WWE
        Case #PB_Event_GadgetDrop          
          Debug EventDropFiles()          
      EndSelect
    Until WWE = #PB_Event_CloseWindow
    
  EndIf
  
EndIf
Benutzeravatar
Kiffi
Beiträge: 10725
Registriert: 08.09.2004 08:21
Wohnort: Amphibios 9

Re: ScintillaGadget: Drag and Drop?

Beitrag von Kiffi »

öhm..., ok..., doch so einfach? :oops: :lol:

Danke! :allright:
a²+b²=mc²
Antworten