Author Topic: Help File Issue  (Read 124 times)

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 538
    • View Profile
Help File Issue
« on: July 04, 2020, 06:29:45 PM »
Robert,

No rush ...

I found 2 issues with the sample at the bottom of the BCX_TABSELECT page.

Here is the corrected code:

Code: [Select]

GUI "TabTest", PIXELS

GLOBAL Form1 AS HWND

SUB FORMLOAD
  Form1 = BCX_FORM("Tab Test", 0, 0, 640, 480)
  BCX_BUTTON("Tab Dialog", Form1, 1000, 10, 10)
  CENTER(Form1)
  SHOW(Form1)
END SUB


BEGIN EVENTS
  SELECT CASE CBMSG
    CASE WM_COMMAND
    SELECT CASE CBCTL
      CASE 1000
      BCX_MDIALOG((DLGPROC)Configure, "Test Tab", Form1, 60, _
      30, 325, 230, 0, 0, "ms sans serif", 8)
    END SELECT
  END SELECT
END EVENTS


BEGIN MODAL DIALOG AS Configure
  STATIC Tabpages[32] AS HWND
  STATIC Tab1 AS HWND

  SHAREDSET Tablabels$[]
    "Page 1", "Page 2", "Page 3", "Page 4"
  END SET

  SELECT CASE CBMSG

    CASE WM_INITDIALOG
    Tab1 = BCX_TAB(hWnd, -300, 4, Tabpages, Tablabels$, 1, 5, 324, 198)
    BCX_BUTTON("Add Tab", hWnd, 90, 200 , 210)
    BCX_BUTTON("Remove Tab", hWnd, 100, 260 , 210)

    FUNCTION = TRUE

    CASE WM_NOTIFY
    BCX_TABSELECT

    CASE WM_COMMAND
    SELECT CASE CBCTL
      CASE 90
      DIM RAW pn = TabCtrl_GetItemCount(Tab1)
      IF pn = 31 THEN EXIT SELECT
      BCX_ADDTAB(Tab1, pn + 1, "Page" & STR$(pn + 1))

      CASE 100
      DIM RAW cur = TabCtrl_GetCurSel(Tab1)
      IF cur = -1 THEN EXIT SELECT
      BCX_REMTAB(Tab1, cur)
    END SELECT
  END SELECT
END DIALOG


Robert

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
Re: Help File Issue
« Reply #1 on: July 04, 2020, 07:06:30 PM »
Robert,

No rush ...

I found 2 issues with the sample at the bottom of the BCX_TABSELECT page.

Here is the corrected code:

Code: [Select]

GUI "TabTest", PIXELS

GLOBAL Form1 AS HWND

SUB FORMLOAD
  Form1 = BCX_FORM("Tab Test", 0, 0, 640, 480)
  BCX_BUTTON("Tab Dialog", Form1, 1000, 10, 10)
  CENTER(Form1)
  SHOW(Form1)
END SUB


BEGIN EVENTS
  SELECT CASE CBMSG
    CASE WM_COMMAND
    SELECT CASE CBCTL
      CASE 1000
      BCX_MDIALOG((DLGPROC)Configure, "Test Tab", Form1, 60, _
      30, 325, 230, 0, 0, "ms sans serif", 8)
    END SELECT
  END SELECT
END EVENTS


BEGIN MODAL DIALOG AS Configure
  STATIC Tabpages[32] AS HWND
  STATIC Tab1 AS HWND

  SHAREDSET Tablabels$[]
    "Page 1", "Page 2", "Page 3", "Page 4"
  END SET

  SELECT CASE CBMSG

    CASE WM_INITDIALOG
    Tab1 = BCX_TAB(hWnd, -300, 4, Tabpages, Tablabels$, 1, 5, 324, 198)
    BCX_BUTTON("Add Tab", hWnd, 90, 200 , 210)
    BCX_BUTTON("Remove Tab", hWnd, 100, 260 , 210)

    FUNCTION = TRUE

    CASE WM_NOTIFY
    BCX_TABSELECT

    CASE WM_COMMAND
    SELECT CASE CBCTL
      CASE 90
      DIM RAW pn = TabCtrl_GetItemCount(Tab1)
      IF pn = 31 THEN EXIT SELECT
      BCX_ADDTAB(Tab1, pn + 1, "Page" & STR$(pn + 1))

      CASE 100
      DIM RAW cur = TabCtrl_GetCurSel(Tab1)
      IF cur = -1 THEN EXIT SELECT
      BCX_REMTAB(Tab1, cur)
    END SELECT
  END SELECT
END DIALOG


Hi MrBCX:

That is good. I only sporadically checked the GUI examples, usually when there was something obvious.