Page 2 of 2

Posted: Mon Feb 06, 2006 1:30 am
by Dräc
Thorsten1867 wrote:
Dräc wrote:EditorGadget: automatically generate scroll bars even if it’s not suitable (for a text just bordered)
Try this:

Code: Select all

SendMessage_(eg, #EM_SHOWSCROLLBAR, #SB_VERT, #False) 
SendMessage_(eg, #EM_SHOWSCROLLBAR, #SB_HORZ, #False)
Thanks, but of course by this way you can do what you want in Windows API.
Just what I'm saying it's that currently, there is not such option in PB.
Thus, a this time, a EditorGadget can’t not be a substitute to a StringGadget as declared below! :)

Posted: Mon Feb 06, 2006 4:08 pm
by Trond
PB wrote:> Exactly what he said. :roll:

Well I didn't have access to PureBasic I asked that, so couldn't "select" it to
see. And I didn't know what he meant by "marked" either... maybe that's
the terminology they use in Germany for "selected"?
Oh, "markere" is also the Norwegian term so I didn't notice it was not normal English.

Posted: Mon Feb 06, 2006 10:26 pm
by heinz.goldbach
Berikco wrote:
The EditorGadget will do all you need, On Windows, Linux And Mac
No, not what i need, because there are several length of lines in my Gadgets in my Program.

1. shortest Answer/Question "Ja" ( 2 Characters)
2. longest Answer(Question (over 200 Characters)

The User had to Scroll in a Gadget over 200 Characters??? When the User read the last part, he dont know what is at the beginning - Think there are three complicate answers.
The possible largeness of the Answer Gadgets is X=200 an y=40

My Program included 600 Questions with 3 possibele Answers for a part of Germany. The Program shoult be converted to the other 15 countrys in Germany.
When you calculate:
600 Qustions and 3 Answers= 2.400 Gadget combinations
2.400* 15 Countrys = 36.000
36.000 * Linux Version * Mac Version =108.000

It is not possible to set manually CR/LF in the Text (hard work for 108.000 Gadget combinations) , because of the Fonts especially in Linux.

In the help file of PB 3.94 for LINUX the Multiline Flag is defined but without function. I took notice after my Windows version is complete ready.

I dont know, how to operate with the editor Gadget with my problem. The user get a Question and three answers. On the right Answer he click and thats all.
Do that with a Editor Gadget. When You click at the Editor Gadget you can edit it or not (#PB_Editor_Readonly flag). Fine, but the Problem exists.

Posted: Fri Dec 28, 2007 10:36 pm
by PB
> The EditorGadget text doesn't appear until it is selected

Um, that's my entire point. :roll:

Posted: Fri Dec 28, 2007 10:48 pm
by Rook Zimbabwe
You have to take a test to get a fishing license in Germany???

I got one by going to the Supermarket and paying $3.21 to the State of Texas for a whole year of everything of legal size that I can catch...

The commercial license costs a bit more but no test is involved there either!!!

Hmmm what a world.

As far as my $0.02: I agree about the editorgadget... count the number of lines in the editorgadget and then capture the text from those lines...

setactivegadget(#Editor_0) does not do this for you?

let me conk something up...

Code: Select all


Enumeration
  #Window_0
EndEnumeration

Enumeration
  #String_0
  #Editor_0
EndEnumeration

Structure VisualDesignerGadgets
  Gadget.l
  EventFunction.l
EndStructure

Global NewList EventProcedures.VisualDesignerGadgets()

Procedure String_0_Event(Window, Event, Gadget, Type)
  Debug "#String_0"
EndProcedure

Procedure Editor_0_Event(Window, Event, Gadget, Type)
  Debug "#Editor_0"
  If #PB_EventType_RightClick
     Debug "RCLICK"
  EndIf
  
EndProcedure

Procedure RegisterGadgetEvent(Gadget, *Function)
  
  If IsGadget(Gadget)
    AddElement(EventProcedures())
    EventProcedures()\Gadget        = Gadget
    EventProcedures()\EventFunction = *Function
  EndIf
  
EndProcedure

Procedure CallEventFunction(Window, Event, Gadget, Type)
  
  ForEach EventProcedures()
    If EventProcedures()\Gadget = Gadget
      CallFunctionFast(EventProcedures()\EventFunction, Window, Event, Gadget, Type)
      LastElement(EventProcedures())
    EndIf
  Next
  
EndProcedure

Procedure Open_Window_0()
  
  If OpenWindow(#Window_0, 5, 5, 400, 200, "Window 0",  #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_TitleBar )
    If CreateGadgetList(WindowID(#Window_0))
      EditorGadget(#Editor_0, 6, 6, 384, 66, #PB_EventType_RightClick)
      SetGadgetItemText(#Editor_0,-1,"EDITOR GADGET: No right-click context menu!") ; *** SHOWS UP NOW
      SetGadgetColor(#Editor_0,#PB_Gadget_BackColor,RGB(0,255,0)) ; Should be green! 
      RegisterGadgetEvent(#Editor_0, @Editor_0_Event())
      StringGadget(#String_0, 6, 78, 384, 72, "STRING GADGET: Has a right-click context menu. :)")
      SetGadgetColor(#String_0,#PB_Gadget_BackColor,RGB(0,255,0)) ; Green. 
      RegisterGadgetEvent(#String_0, @String_0_Event())
      
    EndIf
  EndIf
EndProcedure

Open_Window_0()

Repeat
  
  Event  = WaitWindowEvent()
  Gadget = EventGadget()
  Type   = EventType()
  Window = EventWindow()
  
  Select Event
    Case #PB_Event_Gadget
      CallEventFunction(Window, Event, Gadget, Type)
            
  EndSelect
  
Until Event = #PB_Event_CloseWindow

End
This does what it is supposed to do??? Your problem may be in the animate window OR in the 3.94 code... 8)

I ended up completely rewriting sections of my FREE POS code... Last week I started a whole new version...
[[[ NEW CODE UPDATE ]]]

Now if you want a right click menu popup... This version checks for R MOUSE... It isn't documented but it does work...