例: 簡単なスプラッシュ スクリーン | |
{import * from CURL.ENGINE.BROWSER} {CommandButton label = "View Splash Screen", {on Action do {SplashScreen.setup} || We will now be in a loop and sleep in the loop to fake || some work.. {for i = 0 below 5 do {sleep 1s} } || We are done. Destroy the Splash Screen. {SplashScreen.destroy} } } |
例: スプラッシュ スクリーンの設定 | |
{import * from CURL.ENGINE.BROWSER} {CommandButton label = "View Splash Screen", {on Action do {SplashScreen.setup title = "Splash Screen Example", footer = "Setting up a splash screen...", image-url = {url "../../default/images/curl-splash.png"}, width = 15cm, height = 9cm, delay = 2s } {for i = 0 below 5 do {sleep 1s} } {SplashScreen.destroy} } } |
例: プログレス バーの追加 | |
{import * from CURL.ENGINE.BROWSER} {CommandButton label = "View Splash Screen", {on Action do {SplashScreen.setup title = "Splash Screen Example", footer = "Adding a progress bar...", image-url = {url "../../default/images/curl-splash.png"} } || Show indeterminate progress bar. {SplashScreen.set-progress-bar-indeterminate} || Assume we take 2s to find how much time we will need to || finish the work. {sleep 2s} {SplashScreen.set-progress-bar max = 10.0} let val:double = 0 {for i = 0 below 5 do set val = val + 1.0 {sleep 0.5s} {SplashScreen.set-progress-bar-value val} } {sleep 1s} {SplashScreen.destroy} } } |
例: 一つ以上のイメージの使用 | |
{import * from CURL.ENGINE.BROWSER} {let image-array:StringArray = {StringArray "../../default/images/curl-1.png", "../../default/images/curl-2.png", "../../default/images/curl-3.png", "../../default/images/curl-4.png", "../../default/images/curl-5.png" } } {let footer-array:StringArray = {StringArray "Lower distribution costs ...", "Enterprise RIA ...", "Data Visualization ...", "RIA Technologies ...", "RIA for Desktop..." } } {CommandButton label = "View Splash Screen", {on Action do {SplashScreen.setup title = "Loading Curl Applet", image-url = {url "../../default/images/curl-5.png"} } {SplashScreen.set-progress-bar-indeterminate} {for i = 0 below image-array.size do {SplashScreen.set-footer footer-array[i], halign = "left", font-family = "tahoma" } {SplashScreen.set-image image-url = {url image-array[i]} } {sleep 2s} } {SplashScreen.destroy} } } |
例: テキスト属性の変更 | |
{import * from CURL.ENGINE.BROWSER} {CommandButton label = "View Splash Screen", {on Action do {SplashScreen.setup} {SplashScreen.set-title "Loading Curl Applet", font-family = "tahoma", font-size = 14pt, font-weight = "bold", color = "#006968" } {SplashScreen.set-footer "Documentation Example", halign = "center", font-family = "tahoma", font-size = 14pt, font-weight = "bold", color = "#006968" } {for i = 0 below 5 do {sleep 1s} } {SplashScreen.destroy} } } |
例: サブアプレットの作成 | |
{import * from CURL.ENGINE.BROWSER} {def applet-source:String = {stringify {curl 8.0 applet} {import * from CURL.ENGINE.BROWSER} {define-class public CustomSplashScreenSubApplet {inherits SplashScreenSubApplet} {constructor public {default} {construct-super} } {method public open {create-main-body}:Graphic {self.set-title "Loading applet...", "center", "", 12pt, "bold", "#330033" } {self.set-progress-bar 0, 10, 0 } {self.set-footer "Documentation Example", "center", "", 12pt, "bold", "#330033" } {self.set-image {parse-url "curl://install/docs/default/images/curl_logo.png"}, 0m, 0m } {return {VBox halign = "center", width = 5in, background = {RadialGradientFillPattern {Spectrum.from-envelope "white", 0, "#6685a3", 0.85 }, center = {Fraction2d 0.35, 0.5}, radius = 1.0 }, border-width = 1px, border-color = "#330033", hstretch? = true, framelike-stretch? = true, self.title-frame, {Fill height = 1cm}, {hrule color = "#330033"}, {Fill height = 1cm}, {HBox {Fill}, self.image-frame, {Fill} }, {Fill height = 1cm}, {hrule color = "#330033"}, {Fill height = 1cm}, self.footer-frame, {hrule color = "#330033"}, self.progress-bar-frame } } } } {after 0s do {CustomSplashScreenSubApplet} } } } {CommandButton label = "View Splash Screen", {on Action do {SplashScreen.setup splash-applet-url = {string-url applet-source} } {SplashScreen.set-progress-bar-indeterminate} {sleep 1s} let val:double = 0 {for i = 0 below 5 do set val = val + 2.0 {SplashScreen.set-progress-bar-value val} {sleep 1s} } {SplashScreen.destroy} } } |
例: アニメーションのスプラッシュ スクリーン | |
{import * from CURL.ENGINE.BROWSER} {def applet-source:String = {stringify {curl 8.0 applet} {import * from CURL.ENGINE.BROWSER} {import * from CURL.GUI.SHAPES} {define-class public CustomSplashScreenSubApplet {inherits SplashScreenSubApplet} {constructor public {default} {construct-super} } {method public open {create-main-body}:Graphic {self.set-progress-bar 0, 10, 0 } let company:TextShape = {TextShape font-size = 20pt, color = "#330033", halign = "center", valign = "center", translation = {Distance2d 4cm, 3cm}, "Curl Inc." } let tmr:Timer = {company.animate frequency=20fps, repeat = 18, delay = 1s, {on TimerEvent do {company.apply-rotation (20deg)} {company.apply-scale 1.05, 1.05} } } {return {VBox halign = "center", width = 8cm, background = {LinearGradientFillPattern {Fraction2d 0, 0}, {Fraction2d 1, 1}, {Spectrum.from-endpoints "white", "#66afa4" } }, border-width = 1px, border-color = "#330033", hstretch? = true, framelike-stretch? = true, {Fill height = 1cm}, {hrule color = "#330033"}, {Canvas width = 8cm, height = 6cm, company }, {hrule color = "#330033"}, {Fill height = 1cm}, {hrule color = "#330033"}, self.progress-bar-frame } } } } {after 0s do {CustomSplashScreenSubApplet} } } } {CommandButton label = "View Splash Screen", {on Action do {SplashScreen.setup splash-applet-url = {string-url applet-source} } {sleep 2s} let val:double = 0 {for i = 0 below 5 do set val = val + 2.0 {SplashScreen.set-progress-bar-value val} {sleep 1s} } {SplashScreen.destroy} } } |