Skip to content

Commit

Permalink
Add balham theme and set it as default theme
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Mar 20, 2018
1 parent 58faa6a commit 94f515a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions BBjGridExWidget.bbj
Expand Up @@ -233,7 +233,7 @@ class public BBjGridExWidget extends BBjWidget
if (f_init!) then
dummy$=stbl("!OPTIONS","JAVAFX_HTMLVIEW=true")

html$="<html><body><div id='eventTransporterDiv' onClick='gw_postEvent(event);'></div><div id=""grid"" style=""height: 100%"" class=""ag-theme-fresh""></div></body></html>"
html$="<html><body><div id='eventTransporterDiv' onClick='gw_postEvent(event);'></div><div id=""grid"" style=""height: 100%"" class=""ag-theme-balham""></div></body></html>"
htmlview! = #getCanvas().addHtmlView(101,0,0,#getCanvas().getWidth(),#getCanvas().getHeight(),"")
htmlview!.setCallback(BBjAPI.ON_PAGE_LOADED,#this!,"onLoad")
htmlview!.setCallback(BBjAPI.ON_NATIVE_JAVASCRIPT,#this!,"onNativeEvent")
Expand Down Expand Up @@ -1286,7 +1286,7 @@ rem --------------------api methods--------------------------------
methodend

method public void setTheme(BBjString theme$)
if pos(theme$="dark#fresh#blue#bootstrap#material")>0 then
if pos(theme$="dark#fresh#blue#bootstrap#material#balham#balham-dark")>0 then
if info(3,6)="5" then
s$="$doc.getElementById('grid').className='ag-theme-"+theme$+"';"
else
Expand All @@ -1299,6 +1299,8 @@ rem --------------------api methods--------------------------------

method public BBjVector getThemes()
v! = new BBjVector()
v!.addItem("balham")
v!.addItem("balham-dark")
v!.addItem("dark")
v!.addItem("fresh")
v!.addItem("blue")
Expand Down
3 changes: 2 additions & 1 deletion Demo/Demo.bbj
Expand Up @@ -48,7 +48,7 @@ rem lb_db!.setEnabled(0)


lb_theme!.insertItems(0,grid!.getThemes())
lb_theme!.selectIndex(1)
lb_theme!.selectIndex(0)


process_events
Expand Down Expand Up @@ -154,5 +154,6 @@ return
setTheme:
ev! = BBjAPI().getLastEvent()
theme$ = ev!.getSelectedItem()
print 'SHOW' , theme$
grid!.setTheme(theme$)
return

0 comments on commit 94f515a

Please sign in to comment.