jaPBe 3.13.4 [IDE for PB 4 and PB 5]

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

gnozal,

Thanks for your fast reply!

I started out with a brand-new install of jaPBe, so there was no jaPBe.pref file.
I adjusted the editor coloring so that PB procedures were displayed
differently than my own procedures, so it would be clearer what is going on.

It is almost all procedures that aren't being recognized. Some examples of the few being recognized:
"AddGadgetItem", "ButtonGadget" (but not "TextGadget"), "AddKeyboardShortcut", WAIT A MINUTE!!!

I just figured out that PB procedures stop being recognized in ALPHABETICAL ORDER!
"ButtonImageGadget" (last one in the "B's") is recognized, but "CalendarGadget" is not. How is this possible? :shock:

I don't know if this is important, but procedures from PB libraries and Windows API procedures are recognized correctly.
Also, everything does compile OK.

Is it possible that there is a corrupted file in my PureBasic installation?
KIKI
Enthusiast
Enthusiast
Posts: 145
Joined: Thu Dec 28, 2006 11:49 am
Location: FRANCE

Post by KIKI »

gnozal wrote:
KIKI wrote:I use Windows XP SP2 French version and i have trouble with JAPBE. Every time i open a subwindows and i want to quit this subwindows JAPBE freeze and i am obliged to break the process.
  • 1. Only since the last update ?
    Yes
    2. What do you mean with 'subwindows' : new source file tab ?
    For example if i want to change the language of JAPBE i can change it but after if i click on OK it freeze the program
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

2ebs
Depending on PB compiler version, jaPBe uses different techniques to load the informations :
PB = [4.00, 4.02]
- PB functions -> PBFunctionListing.txt (generated by PBCompiler)
- PB interfaces -> PBInterfaces.txt (generated by PBCompiler)
- PB structures -> PBStructures.txt (generated by PBCompiler)
- API functions -> APIFunctionListing.txt (installed with PB)
PB = [4.1x, ...]
- PB functions -> compiler command 'FUNCTIONLIST'
- PB interfaces -> compiler command 'INTERFACELIST'
- PB structures -> compiler command 'STRUCTURELIST'
- API functions -> APIFunctionListing.txt (installed with PB)

I tried the last jaPBe version with PB4.02 and PB4.10 beta 3 :
- PB4.02 : when I type 'but', I get the following autocompletion list : 'ButtonGadget(, ButtonImageGadget('
- PB4.10b3 : when I type 'but', I get the following autocompletion list : same
- PB4.02 : when I type 'cal', I get the following autocompletion list : 'CalendarGadget(, CalCFunction(, CalCFunctionFast(, ...'
- PB4.10b3 : when I type 'cal', I get the following autocompletion list : same
What do you get ?

2Kiki
I am sorry, I can't reproduce this issue.
Changing the language from English to French for example works well for me.
Did you update all the files (including language) or only the jaPBe exe ?

2All
I have uploaded a debug build (same code, but compiled with debugger) : http://freenet-homepage.de/gnozal/jaPBe_Debug.rar
Maybe it will help to locate the problem.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

I tried the last jaPBe version with PB4.02 and PB4.10 beta 3 :
- PB4.02 : when I type 'but', I get the following autocompletion list : 'ButtonGadget(, ButtonImageGadget('
- PB4.10b3 : when I type 'but', I get the following autocompletion list : same
- PB4.02 : when I type 'cal', I get the following autocompletion list : 'CalendarGadget(, CalCFunction(, CalCFunctionFast(, ...'
- PB4.10b3 : when I type 'cal', I get the following autocompletion list : same
What do you get ?
With 4.10b3, I get the same list when typing "but". However, my list when typing "cal" is:
CallDebugger, CallFunctionFast(, CallWindowProc_(, cAlphaBits, cAlphaShift.
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

gnozal,

Please don't spend any more time trying to figure this out.
I just installed a fresh copy of PB 4.02 and jaPBe worked fine.
I then upgraded the new copy to 4.13b any jaPBe still worked correctly.

Therefore, it has to be something about my PB installation that is messed up.
I will transfer my projects and tools over to the new installation and see if it's all good again.

Thanks! :wink:

Eric
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Clour on Panel TABS please.

Post by RichardL »

Hi Gnozal,
Thank you for your continuing work on jaPBe, it is very much appreciated.

I was recently working on four items at the same time, a Server, two types of Client and a related test utility. I ws hopping between the sources at a rapid rate and found that it was all too easy to select the wrong one. On at least one occassion I ended up making changes to the wrong Client application.

Would it be possible to colour the TAB on the panel gadget so the current one is clearly distinguishable?

Best regards and thanks again for your efforts,

RichardL
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: Clour on Panel TABS please.

Post by gnozal »

RichardL wrote:Would it be possible to colour the TAB on the panel gadget so the current one is clearly distinguishable?
You mean something like this (please run the code) ?

Code: Select all

;{- Enumerations / DataSections
;{ Windows
Enumeration
  #Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
  #Panel_0_0
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}

Procedure.l PanelTabsCallback(hwnd.l, message.l, wParam.l, lParam.l) ; PanelGadget subclassing callback
  Protected ReturnValue.l, TheTextBuffer.s, tab.TC_ITEM, ItemRect.RECT, I.l, TextColor.l
  Shared OldPanelCallback
  If OldPanelCallback
    ReturnValue = CallWindowProc_(OldPanelCallback, hwnd, message, wParam, lParam)
    If message = #WM_ERASEBKGND
      For I = 0 To CountGadgetItems(GetDlgCtrlID_(hwnd)) - 1
        TheTextBuffer = Space(255) 
        tab\mask = #TCIF_TEXT 
        tab\pszText = @TheTextBuffer
        tab\cchTextMax = 255 
        SendMessage_(hwnd, #TCM_GETITEM, I, @tab)
        SendMessage_(hwnd, #TCM_GETITEMRECT, I, @ItemRect.RECT)
        ItemRect\left = ItemRect\left + 4
        If GetGadgetState(GetDlgCtrlID_(hwnd))= I
          ItemRect\top = ItemRect\top + 2
          TextColor = #Red
        Else
          ItemRect\top = ItemRect\top + 4
          TextColor = #Black
        EndIf
        DC = GetDC_(hwnd)
        SetBkMode_(DC, #TRANSPARENT) 
        SelectObject_(DC, GetGadgetFont(GetDlgCtrlID_(hwnd)))
        SetTextColor_(DC, TextColor) 
        SetBkColor_(DC, GetSysColor_(#COLOR_BTNFACE))
        DrawText_(DC, TheTextBuffer, Len(TheTextBuffer), @ItemRect, dtFlags) 
        ReleaseDC_(DC, hwnd)
      Next
      ;
      ReturnValue = #True
    EndIf
  EndIf
  ProcedureReturn ReturnValue 
EndProcedure


Procedure OpenWindow_Window_0()
  Shared OldPanelCallback
  If OpenWindow(#Window_0, 450, 200, 400, 400, "Highlite current tab", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    If CreateGadgetList(WindowID(#Window_0))
      PanelGadget(#Panel_0_0, 24, 31, 355, 345) ;>
        ; Tab #1
        AddGadgetItem(#Panel_0_0, -1, "Tab #1")
        ; Tab #2
        AddGadgetItem(#Panel_0_0, -1, "Tab #2")
        ; Tab #3
        AddGadgetItem(#Panel_0_0, -1, "Tab #3")
        ; Tab #4
        AddGadgetItem(#Panel_0_0, -1, "Tab #4")
        ; Tab #5
        AddGadgetItem(#Panel_0_0, -1, "Tab #5")
      CloseGadgetList() ;<
      
      SetWindowLong_(GadgetID(#Panel_0_0), #GWL_STYLE, GetWindowLong_(GadgetID(#Panel_0_0), #GWL_STYLE) | #TCS_OWNERDRAWFIXED) 
      OldPanelCallback = SetWindowLong_(GadgetID(#Panel_0_0), #GWL_WNDPROC, @PanelTabsCallback())
      
      
    EndIf
  EndIf
EndProcedure

OpenWindow_Window_0()

;{- Event loop
Repeat
  Event = WaitWindowEvent()
  Select Event
    ; ///////////////////
    Case #PB_Event_Gadget
      EventGadget = EventGadget()
      EventType = EventType()
      If EventGadget = #Panel_0_0
      EndIf
      ; ////////////////////////
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
ForEver
;
;}
or this :

Code: Select all

;{- Enumerations / DataSections
;{ Windows
Enumeration
  #Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
  #Panel_0_0
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}

Procedure.l PanelTabsCallback(hwnd.l, message.l, wParam.l, lParam.l) ; PanelGadget subclassing callback
  Protected ReturnValue.l, TheTextBuffer.s, tab.TC_ITEM, ItemRect.RECT, I.l, TextColor.l, BackColor.l
  Shared OldPanelCallback
  If OldPanelCallback
    ReturnValue = CallWindowProc_(OldPanelCallback, hwnd, message, wParam, lParam)
    If message = #WM_ERASEBKGND
      For I = 0 To CountGadgetItems(GetDlgCtrlID_(hwnd)) - 1
        TheTextBuffer = Space(255) 
        tab\mask = #TCIF_TEXT 
        tab\pszText = @TheTextBuffer
        tab\cchTextMax = 255 
        SendMessage_(hwnd, #TCM_GETITEM, I, @tab)
        SendMessage_(hwnd, #TCM_GETITEMRECT, I, @ItemRect.RECT)
        ItemRect\left = ItemRect\left + 4
        If GetGadgetState(GetDlgCtrlID_(hwnd))= I
          ItemRect\top = ItemRect\top + 2
          TextColor = GetSysColor_(#COLOR_BTNFACE)
          BackColor = GetSysColor_(#COLOR_BTNTEXT)
        Else
          ItemRect\top = ItemRect\top + 4
          TextColor = GetSysColor_(#COLOR_BTNTEXT)
          BackColor = GetSysColor_(#COLOR_BTNFACE)
        EndIf
        DC = GetDC_(hwnd)
        SelectObject_(DC, GetGadgetFont(GetDlgCtrlID_(hwnd)))
        SetTextColor_(DC, TextColor) 
        SetBkColor_(DC, BackColor)
        DrawText_(DC, TheTextBuffer, Len(TheTextBuffer), @ItemRect, 0) 
        ReleaseDC_(DC, hwnd)
      Next
      ;
      ReturnValue = #True
    EndIf
  EndIf
  ProcedureReturn ReturnValue 
EndProcedure


Procedure OpenWindow_Window_0()
  Shared OldPanelCallback
  If OpenWindow(#Window_0, 450, 200, 400, 400, "Highlite current tab", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    If CreateGadgetList(WindowID(#Window_0))
      PanelGadget(#Panel_0_0, 24, 31, 355, 345) ;>
        ; Tab #1
        AddGadgetItem(#Panel_0_0, -1, "Tab #1")
        ; Tab #2
        AddGadgetItem(#Panel_0_0, -1, "Tab #2")
        ; Tab #3
        AddGadgetItem(#Panel_0_0, -1, "Tab #3")
        ; Tab #4
        AddGadgetItem(#Panel_0_0, -1, "Tab #4")
        ; Tab #5
        AddGadgetItem(#Panel_0_0, -1, "Tab #5")
      CloseGadgetList() ;<
      
      SetWindowLong_(GadgetID(#Panel_0_0), #GWL_STYLE, GetWindowLong_(GadgetID(#Panel_0_0), #GWL_STYLE) | #TCS_OWNERDRAWFIXED) 
      OldPanelCallback = SetWindowLong_(GadgetID(#Panel_0_0), #GWL_WNDPROC, @PanelTabsCallback())
      
      
    EndIf
  EndIf
EndProcedure

OpenWindow_Window_0()

;{- Event loop
Repeat
  Event = WaitWindowEvent()
  Select Event
    ; ///////////////////
    Case #PB_Event_Gadget
      EventGadget = EventGadget()
      EventType = EventType()
      If EventGadget = #Panel_0_0
      EndIf
      ; ////////////////////////
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
ForEver
;
;}
Last edited by gnozal on Fri Sep 07, 2007 10:34 am, edited 1 time in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Post by RichardL »

Good morning,

Yes, that would do nicely... colouring the background of the TAB would provide an even better visual discriminant.

Richard
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

RichardL wrote:Good morning,

Yes, that would do nicely... colouring the background of the TAB would provide an even better visual discriminant.

Richard
Ok, how about the second code ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Post by RichardL »

:oops: "None so blind as those who do not look in the right place.." as my mum used to say! :oops:

That is even nicer and would do the job perfectly.

Richard
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

Hi gnozal,
both methodes to color the PanelGadget don't handle
the Mouseover-effect with XP-Styles enabled.

Milan
Windows 7 & PureBasic 4.4
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Post by RichardL »

Hi,
I do not think we need any 'mouse-over' effects; just a very clear indication of the current selected TAB... with no 'effects' to confuse things.
Richard
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

The codes not just don't handle them, they destroy the whole caption of the Tab
Windows 7 & PureBasic 4.4
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

milan1612 wrote:The codes not just don't handle them, they destroy the whole caption of the Tab
XP with themes doesn't support owner draw ?
Unfortunately I don't have any PC with XP and themes enabled (disabled by admin here), so I guess XP themes lovers will have to pass for this feature.
With XP themes enabled, the active tab is highlighted anyway iirc.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

>With XP themes enabled, the active tab is highlighted anyway iirc.
Yes, it is highlighted. But move your mouse over a non-highlighted tab...
Windows 7 & PureBasic 4.4
Post Reply