Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hide pages in pageframe?
Message
From
17/05/2005 11:13:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/05/2005 10:45:49
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01014786
Message ID:
01014937
Views:
33
This message has been marked as the solution to the initial question of the thread.
>>Hi Cetin,
>>
>>> What I do is to to set tabs off and use my own 'page tab' controls (command buttons or treeview - it looks like 'options' in task pane). IOW I don't play with the visibility of pages themselves but the navigator.
>>
>>I like your ideas of using a treeview control and command buttons as container navigators vs. using page tabs. I like the way pageframe page tabs look under XP, but the more I use pageframe, the more limitations I come across. Another hassle is dealing with more tabs than can comfortably fit in a pageframe's display area. Your idea of a treeview would handle this situation particularly well.
>>
>>Thank you for your help,
>>
>>Malcolm
>
>Yes I like the treeview best as it also lets you create 'related set of pages'. To user there is no pageframe:)
>Cetin

Malcolm,
Here is a sample.
Public oForm
oForm = Createobject("TVpgf")
oForm.Show

Define Class TVpgf As Form
  Height = 500
  Width  = 600
  Add Object tree As OleControl With ;
    Left = 10, Top = 10,Width = 300,Height = 400,;
    OleClass = 'MSComCtlLib.TreeCtrl'
  Add Object pgf As PageFrame With ;
    PageCount=10, Tabs=.F., Left = 320, Top = 10,Height=400, Width = 200,;
    SpecialEffect=2,BorderWidth=0, ;
    Page1.Caption = "Sample Page",;
    Page5.Caption = "Sample Page%%Related Page",;
    Page4.Caption = "I'm not visible"

  Procedure Init
    With This.pgf
      For ix=1 To .PageCount
        .Pages(m.ix).AddObject("Dummy","Label")
        With .Pages(m.ix).Dummy
          .Caption = "This is page "+Transform(.Parent.PageOrder)
          .Top = 30
          .Visible = .T.
        Endwith
      Endfor
      Local Array arrPages[.Pagecount,2]
      For ix=1 To .PageCount
        arrPages[ix,1] = '_'+Padl(.Pages(ix).PageOrder,3,'0')
        arrPages[ix,2] = .Pages(ix).Caption
      Endfor
      .SetAll('Backstyle',0,'Page')
    Endwith
    Asort(arrPages,2)
    #Define tvwFirst	0
    #Define tvwLast	1
    #Define tvwNext	2
    #Define tvwPrevious	3
    #Define tvwChild	4

    With This.tree
      .linestyle =1
      .labeledit =1
      .indentation = 5
      .PathSeparator = '\'
      .Scroll = .T.
      .OLEDragMode = 0
      .OLEDropMode = 0
      For ix = 1 To Alen(arrPages,1)
        If .F. && Invisible page - ie: arrPages[m.ix,2]=="I'm not visible"
          Loop
        Endif

        If At('%%',arrPages[ix,2]) > 0
          lcNodeText = Substr(arrPages[ix,2],Rat('%%',arrPages[ix,2])+2)
          lcNodeID   = arrPages[ix,1]
          lcParentText = Substr(arrPages[ix,2],1,Rat('%%',arrPages[ix,2])-1)
          lcParentID = arrPages[Asubscript(arrPages, Ascan(arrPages,lcParentText), 1),1]
          oNode = .nodes.Add(lcParentID,tvwChild,lcNodeID,lcNodeText)
        Else
          lcNodeText = arrPages[ix,2]
          lcNodeID   = arrPages[ix,1]
          oNode = .nodes.Add(,tvwFirst,lcNodeID,lcNodeText)
        Endif
        oNode.Expanded = .T.
      Endfor
      .nodes( '_'+Padl(1,3,'0') ).Selected = .T.
    Endwith
  Endproc
  Procedure tree.NodeClick
    Lparameters Node
    Thisform.pgf.ActivePage = Val(Substr(Node.Key,2))
  Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform