Source language: Translate to:

Can i get some help

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Can i get some help

Postby sheppard1 » Sat Jun 01, 2013 6:07 am

Greetings, Getting stuck into neobook and i like it alot....

Heres what i'm needing help with,

Is their a way to load the text from a RTF and into a blank Text square when i select an item in combobox, and with every different selection comes different selected text.

I would Eventually also like to, be able to select a option in combobox, Have it open up options in another combo-box specific to that selection.

also, it it possible to display an image in a blank image square from clicking an option in the combobox.

If any of these things can be done it would be helpful if you could share how and with some specific code, i've been up all night :D trying to figure it out and got soo frustrated.

Thankyou for your time
sheppard1
 
Posts: 25
Joined: Thu May 30, 2013 4:37 pm

Re: Can i get some help

Postby sheppard1 » Sat Jun 01, 2013 6:35 am

Also was thinking would it be easier to just bind the option to a new page......

So far i have this

"[ComboBox2]" "Event Timeline"
GotoPage "LoreTimeline"

but i cant get it change page for per option :(
sheppard1
 
Posts: 25
Joined: Thu May 30, 2013 4:37 pm

Re: Can i get some help

Postby aguilar955 » Sat Jun 01, 2013 8:03 am

Look at the following example

Code: Select all
NBW Publication Source File
(C)1993-2013 NeoSoft Corp.
Title=Untitled NeoBook Publication
Language=US
NeoBookVer=5,80
ScreenColors=16777216
ScreenWidth=320
ScreenHeight=200
BkndColor=0
ScreenAutoSize=Yes
LinkColor=16711680
WindowStyle=0
WindowOrder=0
WindowPos=0
WindowProps=31
BiDiMode=0
UseUpdateTimer=Yes
ReturnTime=60
ShapeTransColor=536870912
SplashProps=3
CompileType=0
MediaType=0
FilesIncluded=1
FontsIncluded=2
CopyExternalFiles=No
SetupMedia=3
SetupInstDir=C:\MyProgram
SetupTitle=Setup
SetupColors=16711680|0|65535
VersionMajor=1
VersionMinor=0
VersionRelease=0
VersionBuild=0
ReqExLevel=1
CustomFontName=Arial
CustomFontSize=9
CustomFontStyle=0
CustomCharset=1
CacheSize=30
ExtractOp=132
L_OK=OK
L_CANCEL=Cancel
L_YES=Yes
L_NO=No
L_CLOSE=Close
L_ERRORTITLE=Error
L_FINDTITLE=Find
L_FINDPROMPT=Find &What
L_FINDFIRST=&Find First
L_FINDNEXT=Find &Next
L_FINDERROR=Search text not found.
L_PWORDTITLE=Password required
L_PWORDMSG=Before continuing, you must first|enter the correct password.
L_PWORDPROMPT=&Password:
L_PWORDERROR=That's not the right password!
L_MEDIAERROR=In order to play this type of file you must install|the appropriate multimedia hardware and/or|software.
L_INTERNETERROR=Unable to locate Internet Browser software.
L_ABORTFUNCTION=Do you want to cancel this function?
L_EXTRACTERROR=This file could not be extracted and cannot be played.
L_INSTDIRPROMPT=Please enter the drive and directory where you would like this program to be installed. To accept the default drive and directory, simply press Enter.
L_INSTFOLDERPROMPT=Do you wish to create a program folder?
L_INSTRUNPROMPT=Do you want to run
L_INSTDISKPROMPT=Please insert disk #
L_INSTDISKERROR=That's not the correct disk, try again.
L_INSTGENERROR=The installation has terminated.
L_INSTEXITPROMPT=Do you really want to cancel the installation?
L_INSTWINTITLE=Setup
L_INSTPROGTITLE=Extracting Files...
L_SENDEMAIL=Sending Mail...
L_MAILSERVER=Please enter the name of your outgoing email server:
L_COPY=Copy to Clipboard
L_SELECTALL=Select All
L_DONWLOADFILE=Downloading: %s
L_PLEASEWAIT=Please wait...
TrayMenuBegin
MenuName=TrayOpen
MenuText=Open
MenuState=3
MenuKey=0
MenuAction=SetVar "[WindowState]" "Normal"
MenuName=TrayExit
MenuText=Exit
MenuState=3
MenuKey=0
MenuAction=Exit "" ""
MenuEnd
MasterPage
NewPage=New Page
PageStyle=0
PageColor=16777215
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
ObjectType=11
Name=ComboBox1
X=32
Y=36
W=209
H=24
Anchor=0
Text=item1¶item2¶item3
VarName=[ComboBox1]
VarType=0
ObjAction=If "[ComboBox1]" "=" "item1"¶    GotoPage "[ComboBox1]"¶Else¶¶EndIf¶¶If "[ComboBox1]" "=" "item2"¶    GotoPage "[ComboBox1]"¶Else¶¶EndIf¶¶If "[ComboBox1]" "=" "item3"¶    GotoPage "[ComboBox1]"¶Else¶¶EndIf
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1
NewPage=item1
PageStyle=0
PageColor=16777215
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
ObjectType=8
Name=Text1
X=64
Y=6
W=60
H=29
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 item1}}}
HMargin=4
VMargin=4
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=1
NewPage=item2
PageStyle=0
PageColor=16777215
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
EffectSpeed=0
ObjectType=8
Name=Text2
X=64
Y=6
W=60
H=29
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 item2}}}
HMargin=4
VMargin=4
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=1
NewPage=item3
PageStyle=0
PageColor=16777215
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
ObjectType=8
Name=Text3
X=64
Y=6
W=60
H=29
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 item3}}}
HMargin=4
VMargin=4
LineColor=0
LineWidth=0
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=1
aguilar955
 
Posts: 85
Joined: Sat Jan 17, 2009 10:50 am

Re: Can i get some help

Postby dpayer » Sat Jun 01, 2013 8:10 am

sheppard1 wrote:Greetings, Getting stuck into neobook and i like it alot....
also, it it possible to display an image in a blank image square from clicking an option in the combobox.

If any of these things can be done it would be helpful if you could share how and with some specific code, i've been up all night :D trying to figure it out and got soo frustrated.

Thankyou for your time


Looks like Aguilar and I hit the reply button at the same time!

I have a sample for the point above. To see it, create a new (blank) 800x600 pub and paste the code below into it.

David P.

Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=11
Name=ComboBox1
X=29
Y=90
W=182
H=26
Anchor=0
Text=Neobook¶Neopaint¶DatabasePro
VarName=[ComboBox1]
VarType=0
XPTheme=Yes
ObjAction=If "[combobox1]" "=" "Neobook"¶   SetVar "[selectedfile]" "[pubdir]neobook.jpg"¶Endif¶If "[combobox1]" "=" "Neopaint"¶   SetVar "[selectedfile]" "[pubdir]paint.png"¶Endif¶If "[combobox1]" "=" "DatabasePro"¶   SetVar "[selectedfile]" "[pubdir]dbp.jpg"¶Endif¶¶RefreshObject "Picture1"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Enabled=No
TabOrder=1
ObjectType=3
Name=PushButton1
X=22
Y=26
W=182
H=38
Anchor=0
Text=Download files
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=DownloadFile "http://www.neosoftware.com/npw-sm.png" "[pubdir]paint.png" ""¶DownloadFile "http://www.neosoftware.com/nbw-sm.jpg" "[pubdir]neobook.jpg" ""¶DownloadFile "http://www.neosoftware.com/dbpro-sm.jpg" "[pubdir]dbp.jpg" ""¶EnableObject "ComboBox1"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=8
Name=Text1
X=218
Y=30
W=314
H=35
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs32\cf0 Download first, then select}}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=12632256
FillPattern=1
TabOrder=2
ObjectType=4
Name=Picture1
X=292
Y=87
W=293
H=245
Anchor=0
FileName=[selectedfile]
PictStyle=0
Resample=Yes
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=1
TabOrder=5
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Can i get some help

Postby sheppard1 » Sat Jun 01, 2013 8:28 am

thankyou that sorts the images, one step further forward i suppose xD

also is it possible to do combobox selection to change page eg. select option 1 it takes you to page 1, select option 55 takes you to page 55.

and the one that has been bugging me for ages....If you can find a solution for this i would be grateful.

How do i go about this, Imagine 3 comboboxes, 1st box contains 10 words, 2nd combobox shows a different list depending on the option selected, and the 3rd does the same as the 2nd aswell as showing another image in a image box depending on what is selected..

Bah so guess thats an extension of what you have just given me...
sheppard1
 
Posts: 25
Joined: Thu May 30, 2013 4:37 pm

Re: Can i get some help

Postby sheppard1 » Sat Jun 01, 2013 8:44 am

For Future Referance,

HOW TO Go To Page From Combo option,

Code: Select all
If "[combobox2]" "=" "Event Timeline"
   GotoPage "LoreTimeline"
Endif


cant believe i figured that out myself lol
sheppard1
 
Posts: 25
Joined: Thu May 30, 2013 4:37 pm

Re: Can i get some help

Postby mishem » Sat Jun 01, 2013 9:13 am

I do not know about you, but in this forum with such questions immediately send read help.
:)
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

Re: Can i get some help

Postby sheppard1 » Sat Jun 01, 2013 9:19 am

Sorry about it you could say i'm stupid then......I did read the help file but it was just confusing around anything code related

Least i figured out combo to combo link, Just need Combo to Rich text and i will be set.
Code: Select all
If "[combobox1]" "=" "Neobook"
   SetVar "[combobox2]" "Article1"
Endif
sheppard1
 
Posts: 25
Joined: Thu May 30, 2013 4:37 pm

Re: Can i get some help

Postby dpayer » Sat Jun 01, 2013 10:07 am

sheppard1 wrote:Sorry about it you could say i'm stupid then......I did read the help file but it was just confusing around anything code related

Least i figured out combo to combo link, Just need Combo to Rich text and i will be set.
Code: Select all
If "[combobox1]" "=" "Neobook"
   SetVar "[combobox2]" "Article1"
Endif


May I suggest reading the entire helpfile a couple times. I do this periodically to refresh my memory on how certain action codes work. Also there are many examples in this forum of people having solved problems like you are doing. Also, look at the Resource Center (link in upper right of this page) to see many projects that people have coded and have given away for someone like yourself to learn from.

It is permitted to copy code from others :) when they give it away.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Can i get some help

Postby aguilar955 » Sat Jun 01, 2013 10:14 am

sheppard1 wrote:How do i go about this, Imagine 3 comboboxes, 1st box contains 10 words, 2nd combobox shows a different list depending on the option selected, and the 3rd does the same as the 2nd aswell as showing another image in a image box depending on what is selected..


Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5,80
ObjectType=11
Name=ListaDesplegable1
X=19
Y=87
W=150
H=26
Anchor=0
Text=Sirea¶cdl
VarName=[ListaDesplegable1]
VarType=0
XPTheme=Yes
ObjAction=If "[ListaDesplegable1]" "=" "Sirea"¶    ListBoxDeleteItem "ListaDesplegable2" "All"¶    ListBoxAddItem "ListaDesplegable2" "0" "Shades of Geometry Icons"¶    ListBoxAddItem "ListaDesplegable2" "0" "Hearts Icons"¶    EnableObject "ListaDesplegable2"¶EndIf¶If "[ListaDesplegable1]" "=" "cdl"¶    ListBoxDeleteItem "ListaDesplegable2" "All"¶    ListBoxAddItem "ListaDesplegable2" "0" "Empty Set Icons"¶    ListBoxAddItem "ListaDesplegable2" "0" "Roman Numeral Clock Icons"¶    EnableObject "ListaDesplegable2"¶EndIf
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Enabled=No
TabOrder=2
ObjectType=11
Name=ListaDesplegable2
X=20
Y=132
W=149
H=26
Anchor=0
VarName=[ListaDesplegable2]
VarType=0
XPTheme=Yes
ObjAction=If "[ListaDesplegable2]" "=" "Shades of Geometry Icons"¶¶    SetVar "[imagen]" "[PubDir]hvezdice6.ico"¶    RefreshObject "Imagen1"¶EndIf¶If "[ListaDesplegable2]" "=" "Hearts Icons"¶    SetVar "[imagen]" "[PubDir]heart2.ico"¶    RefreshObject "Imagen1"¶EndIf¶If "[ListaDesplegable2]" "=" "Empty Set Icons"¶    SetVar "[imagen]" "[PubDir]small block.ico"¶    RefreshObject "Imagen1"¶EndIf¶If "[ListaDesplegable2]" "=" "Roman Numeral Clock Icons"¶    SetVar "[imagen]" "[PubDir]Clock-H200-S125.ico"¶    RefreshObject "Imagen1"¶EndIf
ObjEnterAction=SetVar "[imagen]" ""¶RefreshObject "Imagen1"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Enabled=No
TabOrder=3
ObjectType=3
Name=Boton1
X=19
Y=17
W=73
H=43
Anchor=0
Text=Download
Hint=Download first, then select
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=DownloadFile "http://www.rw-designer.com/icon-download.php?id=1858" "[PubDir]hvezdice6.ico" ""¶DownloadFile "http://www.rw-designer.com/icon-download.php?id=1896" "[PubDir]heart2.ico" ""¶DownloadFile "http://www.rw-designer.com/icon-download.php?id=6351" "[PubDir]small block.ico" ""¶DownloadFile "http://www.rw-designer.com/icon-download.php?id=6244" "[PubDir]Clock-H200-S125.ico" ""¶EnableObject "ListaDesplegable1"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=4
Name=Imagen1
X=201
Y=36
W=97
H=121
Anchor=0
FileName=[imagen]
PictStyle=0
Resample=Yes
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=5
aguilar955
 
Posts: 85
Joined: Sat Jan 17, 2009 10:50 am

Re: Can i get some help

Postby sheppard1 » Sat Jun 01, 2013 10:28 am

Using what you have just posted, is it possible to change the items listed to just words until the last sequence which sows image.....

Also will this be able to handle a ton of data, as i plan on adding alot


Edit: Just messed around i can see how its done now. Means alot btw
sheppard1
 
Posts: 25
Joined: Thu May 30, 2013 4:37 pm

Re: Can i get some help

Postby sheppard1 » Sat Jun 01, 2013 3:14 pm

Yep i have just read it all through again, complicated things i'm sailing through and easy stuff am tripping over, no idea why xD

If you get a chance, how do i Get the text of an article to change depending on which option from dropdown i select, Am i supposed to be using filetovar or fileread, filewrite?
sheppard1
 
Posts: 25
Joined: Thu May 30, 2013 4:37 pm

Re: Can i get some help

Postby mishem » Sat Jun 01, 2013 5:39 pm

If I understand correctly ...
look ArticleJumpTo

And yes, you can use FileRead FileToVar
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

Re: Can i get some help

Postby Wrangler » Sun Jun 02, 2013 7:51 am

Also note that you can use variables in Article text. Change the variable contents, and it will change the text in the article.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests

cron