First, in Windows XP only when I add a new tab to a panel and then add a Editor gadget to the tab I loose the border around the Editor gadget. I did find a work around by using invalidateRect API call but I think this is a bug in the Editor or panel Gadget. (see code below for example)
Second, this is the first time I have used the panel gadget and the example below fails for calling a 'CloseGadgetList' before calling an open. It does this only after the seventh tab. I have to be missing something.
Example Code:
Code: Select all
;-Init Constants
#WindowIndex =0
#GadgetIndex =0
#ImageIndex =0
#StatusBarIndex =0
#MenuBarIndex =0
;-Window Constants
#Window_Form1 = #WindowIndex:#WindowIndex=#WindowIndex+1
#Window_About = #WindowIndex:#WindowIndex=#WindowIndex+1
;-Gadget Constants
;Window_Form1
#MenuBar_Form1 = #MenuBarIndex:#MenuBarIndex=#MenuBarIndex+1
#MenuBar_Form1_New = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#MenuBar_Form1_Open = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#MenuBar_Form1_Save = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#MenuBar_Form1_Exit = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#MenuBar_Form1_Settings = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#MenuBar_Form1_Help = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#MenuBar_Form1_About = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_Form1_Panel1 = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_Form1_Editor1_1 = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#StatusBar_Form1 = #StatusBarIndex:#StatusBarIndex=#StatusBarIndex+1
#StatusBar_Form1_Field1 = 0
;Window_About
#Gadget_About_RJPLogo = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_Appname = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_Version = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_VersionText = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_Build = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_BuildText = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_Copyright = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_Homepage = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_OK = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
#Gadget_About_Frame3D12 = #GadgetIndex:#GadgetIndex=#GadgetIndex+1
;-Image Constants
#Image_About_RJPLogo = #ImageIndex:#ImageIndex=#ImageIndex+1
;- General Constants
#BUILD = #PB_COMPILER_DATE
;-Load Images
;CatchImage(#Image_About_RJPLogo,?_IMG_About_RJPLogo)
; DataSection
; _IMG_About_RJPLogo:IncludeBinary "Images\rjplogo_small.bmp"
; EndDataSection
;--------------------
;-Language Data
Procedure Build_Language(languagefile.s)
Dim language.s(10)
flag.l=0
If languagefile<>"" And FileSize(languagefile)>0
If ReadFile(0,languagefile)
For tmp=1 To 10
language(tmp)=ReadString()
Next
flag=1
CloseFile(0)
EndIf
EndIf
If flag=0
Restore LanguageData
For tmp=1 To 10
Read language(tmp)
Next
EndIf
EndProcedure
Build_Language("")
DataSection
LanguageData:
Data.s "About"
Data.s "Panel Test"
Data.s "Version :"
Data.s "0.01"
Data.s "Build :"
Data.s ""
Data.s "Copyright (c) 2003 RJP Computing"
Data.s "www.rjpcomputing.com"
Data.s "OK"
Data.s ""
EndDataSection
Procedure.l Window_Form1()
If OpenWindow(#Window_Form1,175,0,400,300,#PB_Window_SystemMenu|#PB_Window_WindowCentered|#PB_Window_Invisible,language(2))
CreateMenu(#MenuBar_Form1,WindowID(#Window_Form1))
MenuTitle("File")
MenuItem(#MenuBar_Form1_New,"New")
MenuBar()
MenuItem(#MenuBar_Form1_Open,"Open")
MenuItem(#MenuBar_Form1_Save,"Save")
MenuBar()
MenuItem(#MenuBar_Form1_Exit,"Exit")
MenuTitle("Edit")
MenuItem(#MenuBar_Form1_Settings,"Settings")
MenuTitle("Help")
MenuItem(#MenuBar_Form1_Help,"Help")
MenuBar()
MenuItem(#MenuBar_Form1_About,"About")
If CreateGadgetList(WindowID())
PanelGadget(#Gadget_Form1_Panel1,0,0,400,256)
AddGadgetItem(#Gadget_Form1_Panel1,-1,"Tab1")
EditorGadget(#Gadget_Form1_Editor1_1,0,0,395,232)
CloseGadgetList()
CreateStatusBar(#StatusBar_Form1,WindowID(#Window_Form1))
AddStatusBarField(100)
HideWindow(#Window_Form1,0)
ProcedureReturn WindowID()
EndIf
EndIf
EndProcedure
Procedure.l Window_About(pParent.l)
If OpenWindow(#Window_About,175,0,260,155,#PB_Window_WindowCentered|#PB_Window_Invisible,language(1),WindowID(pParent))
;MakeToolWindow(WindowID(#Window_About), #True) ;Uses the PureTools Lib
If CreateGadgetList(WindowID())
;ImageGadget(#Gadget_About_RJPLogo,5,10,67,49,UseImage(#Image_About_RJPLogo),#PB_Image_Border)
TextGadget(#Gadget_About_Appname,90,10,165,15,language(2))
TextGadget(#Gadget_About_Version,90,30,45,15,language(3))
TextGadget(#Gadget_About_VersionText,135,30,120,15,language(4))
TextGadget(#Gadget_About_Build,90,50,30,15,language(5))
TextGadget(#Gadget_About_BuildText,120,50,135,15,Str(#PB_COMPILER_DATE))
TextGadget(#Gadget_About_Copyright,15,80,230,15,language(7),#PB_Text_Center)
HyperLinkGadget(#Gadget_About_Homepage,70,105,115,15,language(8),16744448)
ButtonGadget(#Gadget_About_OK,95,130,60,20,language(9),#PB_Button_Default)
Frame3DGadget(#Gadget_About_Frame3D12,5,65,250,60,language(10))
HideWindow(#Window_About,0)
ProcedureReturn WindowID()
EndIf
EndIf
EndProcedure
;-Main Loop
If Window_Form1()
panelCount = 2
editorCount = 2
quitForm1=0
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #PB_Event_CloseWindow
If EventWindowID()=#Window_Form1
quitForm1=1
ElseIf EventWindowID()=#Window_About
CloseWindow(#Window_About)
ActivateGadget(#Gadget_Form1_Editor1_1)
EndIf
Case #PB_Event_Menu
Select EventMenuID()
Case #MenuBar_Form1_New
;CallDebugger
OpenGadgetList(#Gadget_Form1_Panel1)
AddGadgetItem(#Gadget_Form1_Panel1,-1,"Tab " + Str(panelCount)) : panelCount + 1
EditorGadget(editorCount,0,0,395,232):editorCount+1
CloseGadgetList() ; <----- this fails for closeing without opening after the
; 'Tab 7' is created
; This is needed to bet the border back around the Editor Gadget!
; I think this might be an XP bug. (It only does it on XP)
invalidateRect_(GadgetID(#Gadget_Form1_Panel1), 0, 1)
Case #MenuBar_Form1_Open
Case #MenuBar_Form1_Save
Case #MenuBar_Form1_Exit
quitForm1 = 1
Case #MenuBar_Form1_Settings
Case #MenuBar_Form1_Help
Case #MenuBar_Form1_About
Window_About(#Window_Form1)
EndSelect
Case #PB_Event_Gadget
Select EventGadgetID()
Case #Gadget_Form1_Panel1
Case #Gadget_Form1_Editor1_1
Case #Gadget_About_OK
CloseWindow(#Window_About)
ActivateGadget(#Gadget_Form1_Editor1_1)
Case #Gadget_About_Homepage
RunProgram("http://www.rjpcomputing.com")
EndSelect
EndSelect
Until quitForm1
CloseWindow(#Window_Form1)
EndIf
End



