Generally ID$ is the name you are giving this widget or view being created, while View$ is the name of the view or Window to place your view or widget on.
First you need to add tabs to the tabview:
TABVIEW x1,y1 TO x2,y2, ID$, Option$, View$
** View$ is the name of the view or window you are place the tabview on.
Generates a View for Tabs with the ID$ (internal name of the Tabview)
Then you need to add tabviews:
TABVIEW ADD ID$, âDisplayed Name of Viewâ
If you want to place anything on it you need to tell it on which tab. This is by the number you add the tabs to the tabview:
BUTTON 0,0 TO 100,20, ID$, âDisplayed Name of Buttonâ, âTabviewname1â (ID$+â1â)
If you add more then one:
BUTTON 0,0 TO 100,20, ID$, âDisplayed Name of Buttonâ, âTabviewname2â (ID$+â2â)
and so on
My current yab beginners tutorial are here:
http://old.besly.de/menu/search/archiv/dev/yab_shelltool_gui.html
Because the old one are not up to date (written long time ago):
http://old.besly.de/menu/search/archiv/dev/yab_tutorial_eng.html
http://old.besly.de/menu/search/archiv/dev/yab_tutorial2_eng.html
http://old.besly.de/menu/search/archiv/dev/yab_game_tutorial_eng.html
This are the main tutorials for the beginnerâŚ
http://old.besly.de/menu/search/archiv/dev/yab_ide_eng.html
http://old.besly.de/menu/search/archiv/dev/yab_wasistwas_eng.html
http://old.besly.de/menu/search/archiv/dev/yab_layout_eng.html
http://old.besly.de/menu/search/archiv/dev/yab_chr_eng.html
http://old.besly.de/menu/search/archiv/dev/yab_laws.html
Thank you both for your replies. Iâll do more experimentation when Iâll have more time. For now I tested the tabview on top of a view, then without a view - directly on the window. Both work, but the IDEâs documentation doesnât mention anything about their significance. I didnât have enough time to also read the online documentation, but I will. Is there a reason to use the view between the main window and a tab view?
Anyway, I hope the IDEâs documentation will be updated to clarify these things. Is it somewhere on a git scm? I found some minor issues in various places and I could send the fixes as pull requests.
tabview set:
- âSynopsysâ (mistyped)
- Related: tabview tabview add, tasbview get (plus missing comma after the first tabview)
tabview get: also missing a comma after the first tabview
I does not clearly understand what you mean. The window is a view himself, if you place a view on it you know its name id$. If you place a tabview on it, you use it already :).
@bbjimmy gave me this example: window -> view -> tabview. So I asked because the documentation doesnât make it clear what is necessary for a tabview, and whatâs the role of views.
in the case one needs to add / remove tabs based on user input. Tabview has no way to remove a tab, but one could remove the containing view, re-add it and the tabview, then and the required tabs.
example:
screenWidth = peek("desktopwidth")
screenHeight = peek("desktopheight")
window open screenWidth/2-200, screenHeight/2-200 to screenWidth/2+200, screenHeight/2+200, "MainWindow", "Test"
VIEW 0,0 TO 400,320, "BackgroundView","MainWindow"
TABVIEW 5,2 TO 395,300, "Test", "top", "BackgroundView"
TABVIEW ADD "Test", "Tab1"
BUTTON 5,5 TO 105,25, "BT:Hui", "Hui", "Test1"
TABVIEW ADD "Test", "Tab2"
BUTTON 5,350 TO 100,375, "BT:Remove", "Remove", "MainWindow"
BUTTON 105,350 TO 200,375, "BT:Add", "Add", "MainWindow"
dim part$(1)
inloop = true
while(inloop)
msg$ = message$
if (split(msg$, part$(), ":|") > 2) then
PartOne$=part$(1)
PartTwo$ = part$(2)
PartThree$ = part$(3)
fi
if (split(msg$, part$(), ":|") > 3) then
PartFour$ = part$(4)
fi
if (msg$ <> "") print msg$
switch msg$
//Cases
case "BT:Add|"
exist= VIEW GET "BackgroundView","exists"
if !exist then
VIEW 0,0 TO 400,320, "BackgroundView","MainWindow"
TABVIEW 5,2 TO 395,300, "Test", "top", "BackgroundView"
TABVIEW ADD "Test", "Tab1"
TABVIEW ADD "Test", "Tab2"
BUTTON 5,5 TO 105,25, "BT:Hui", "Hui", "Test1"
endif
break
case "BT:Remove|"
exist= VIEW GET "BackgroundView","exists"
//tabview remove "Test",1
if exist VIEW REMOVE "BackgroundView"
break
case "MainWindow:_QuitRequested|"
WINDOW CLOSE "MainWindow"
break
default:
end switch
if(window count<1) inloop = false
sleep 0.1
wend'
Discussions like this might fit better on http://yab.orgfree.com/forum/