Seite 2 von 2

Re: PB 5.10 - Mauszeiger in der IDE

Verfasst: 17.01.2013 11:29
von Kurzer
Schade, man kommt mit folgender Methode wohl nicht mehr an das Scintilla handle der PB IDE (getestet mit PB 5.00 unter Win 7):

Val(GetEnvironmentVariable("PB_Tool_Scintilla"))

:cry:

Re: PB 5.10 - Mauszeiger in der IDE

Verfasst: 17.01.2013 13:02
von ts-soft
Kurzer hat geschrieben:Schade, man kommt mit folgender Methode wohl nicht mehr an das Scintilla handle der PB IDE (getestet mit PB 5.00 unter Win 7):

Val(GetEnvironmentVariable("PB_Tool_Scintilla"))

:cry:
Klar, wenn man als Tool der IDE gestartet wurde, klappt das auch <)

Re: PB 5.10 - Mauszeiger in der IDE

Verfasst: 17.01.2013 14:07
von Kurzer
Ach, ts-soft, wenn ich Dich nicht hätte. :D
Ich ging davon aus, dass die Variable auch schon zur Laufzeit des Editors existiert.

Leider kennt PB 5.10 die Konstante #SCI_SETMARGINCURSORN nicht. Vermutlich kennt die verwendet Scintilla.dll dann die entsprechende Message auch nicht (zu alte Version?).

Habe es wie folgt versucht (funktioniert aber nicht):

Code: Alles auswählen

scintilla=Val(GetEnvironmentVariable("PB_Tool_Scintilla"))
 If scintilla
   SendMessage_(scintilla,2248,2,0) ; 2 (normaler Cursor) oder 7 (reverser Cursor)
 EndIf
 End
Die Werte 2248 und 2/7 habe ich der Scintilla headerdatei entnommen.
Vermutlich steckt der Teufel wieder mal im Detail. :) Egal, war nen Versuch. :)

Re: PB 5.10 - Mauszeiger in der IDE

Verfasst: 17.01.2013 15:46
von Josh
Kurzer hat geschrieben:Vermutlich steckt der Teufel wieder mal im Detail. :) Egal, war nen Versuch. :)
Funktioniert schon, Parameter 3 ist die Marginnummer und erst Parameternummer 4 ist der Cursor. Folgendes Beispiel momentan nur als Scintillagadget und nicht die IDE:

Code: Alles auswählen

  If OpenWindow(0, 0, 0, 320, 90, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  
     If InitScintilla()
        ScintillaGadget(0, 10, 10, 300, 70, #Null)
        
        ; Output set to red color
        ScintillaSendMessage(0, #SCI_STYLESETFORE, 0, RGB(255, 0, 0))
        
        ; Set the initial text to the ScintillaGadget
        ScintillaSendMessage(0, #SCI_SETTEXT, 0, @"This is a simple ScintillaGadget with text...")
        
        ; Adding a second line of text with linebreak before
        Text$ = Chr(10) + "Second line"
        ScintillaSendMessage(0, #SCI_APPENDTEXT, Len(Text$), @Text$)

        #SCI_SETMARGINCURSORN  = 2248
        #SC_CURSORARROW        = 2
        #SC_CURSORREVERSEARROW = 7
        ScintillaSendMessage (0, #SCI_SETMARGINCURSORN, 1, #SC_CURSORARROW)

     EndIf
     
     Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Danke euch allen für eure Bemühungen.

Re: PB 5.10 - Mauszeiger in der IDE

Verfasst: 17.01.2013 15:51
von Kurzer
Danke Josh!

jetzt klappts auch als Tool. :allright:

Code: Alles auswählen

EnableExplicit

#SCI_SETMARGINCURSORN  = 2248
#SC_CURSORARROW        = 2
;#SC_CURSORREVERSEARROW = 7

Declare Scintilla.i

Scintilla = Val(GetEnvironmentVariable("PB_Tool_Scintilla"))
If Scintilla
	SendMessage_(Scintilla, #SCI_SETMARGINCURSORN, 0, #SC_CURSORARROW)
EndIf
End
Mauszeiger ist wieder wie in 4.61 -