It is currently Wed Mar 22, 2017 7:13 pm

Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!

Post new topic Reply to topic  [ 129 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13  Next
Author Message
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Sun Apr 13, 2014 11:53 am 

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
Just uploaded v1.12 of the Graphic Controls. See change list below for details of what has
As usual if I've messed things up, any bugs are spotted or you have suggestions, please let me know.

!v1.12 Changes:
!* Added new Button style "bcBEVEL$". Causes button to be
! drawn with beveled corners.
! i.e: _______ .---------.
! / \ | |
! | | instead of | |
! \_______/ '---------'
! Style can be combined with other styles like bcFLAT$ and
! bcNOBORDER$ if required.
! Introduced to help visually indentify and distinquish buttons
! from other controls.
!* Change to DrawPicture routine. If the supplied
! picture name (in a controls Data parameter) contains
! a "/" it will be assumed that a full path and filename has
! been specified and the current form's picture path will not
! be used. This is to enable pictures not in the current
! form's picture path (specified in the DrawForm command) to
! be displayed.
!* Changed to how Picture Path is handled for "main" Frame
! controls (i.e: the first control encountered when a
! DrawForm command is executed).
! If the DrawForm Picture Path parameter is set to "-"
! then the current Picture Path will remain unchanged.
! Otherwise, both the current path and the new path will be
! stored along with the Frame's data. Whenever the Frame is
! made visible the Picture Path will be set to the new Path.
! Whenever the Frame is hidden the Picture Path will be
! reset back to stored current path value.
!* Added new Picture Control style "bcPICSIZE$". When used the
! Picture will be scaled so that the smallest picture dimension
! matches that of the Control.
! e.g.:
! .------.----------------.-----. For Picture Height less than Width:
! |###|@@@@@@@|###| 1. Picture Height scaled to Control Height.
! |###|@@@@@@@|###| 2. Picture Width scaled to maintain aspect
! |###|@@@@@@@|###| ratio.
! |###|@@@@@@@|###| 3. Picture drawn clipped horizontally
! '------'----------------'-- ---' centered within Control."@" indicates
! the Picture Control (the visible area)
! and "#" indicates the clipped (hidden) picture area.
!* Added new Picture Control style "bcPICSCROLL$". Used with the
! new "bcPICSIZE$" style. Causes a scroll bar to be drawn within
! the Picture Control enabling the Picture to be scrolled either
! Left and Right or Up and Down so all areas of the picture can
! be viewed.
! In the above bcPICSIZE$ example it would cause a horizontal
! scroll bar to be drawn at the bottom of the Picture control.
! When a scroll bar is clicked the picture will be redrawn in the
! new position (if required) and then return the click action
! to the calling code.
!* Added new function call "GetCtrlBmpOffs(pctrlno,&px,&py)". Function
! returns the X and Y offsets used to draw the picture. When a picture
! clicked, the click coordinates are relative to the picture control so
! these offsets need to be added to position the click point on the
! actual picture. Returned offsets are positive values.
!* More bugs with control scaling fixed when forms drawn
! on different screen sizes or changed orientation.
! Fixes include sizing & positioning of virtual
! keyboard, positioning & sizing of Calendar, positioning
! of MsgBox and changes to function SetScalingFactor
! (should now work correctly scaling forms to any screen
! size/orientation).
!* Updated processing for buttons with bcMenuList$ style.
! If an entry in the Menu List begins with the Not character
! ("�") it will be drawn grayed out and will not be
! selectable (ie: Only list entries not starting with the
! "�" character can be selected and their value passed back
! to the calling program).
! In order to allow this type of menu to be setup, the
! TouchCheck routine has been changed as follows:
! (1) When a MenuList style button is pressed the routine
! will return to the calling program with a Control
! value of 2082,
! (2) The calling program can then either ignore the
! control value or execute code to setup the buttons
! Menu List values and set a new buttons Caption
! Value.
! (3) When control returns to the TouchCheck routine,
! the actual click processing for the button will take
! place as before (using the updated list values if
! changed).
! See ExpenseTracker sample program for examples of this
! type of Menu.
!* Various small Bug fixes.
!* Added new user function NumToStr$(n,s,d,z). Converts
! a number to a formated string.
! eg: NumToStr$(1234.56,0,0,0) returns "1234".
! Parameters:
! n - Number to be Formated.
! s - Use Separators (0 or 1).draw
! eg: Value "0" produces "1234567".
! Value "1" produces "1,234,567".
! d - Number of Decimal Places (0 to 6).
! eg: Value "0" produces "1234".
! Value "2" produces "1234.56".
! z - Use Leading zeroes (0 to 9).
! eg: Value "0" produces "1234".
! Value "6" produces "001234"
! Note: Any combination of parameters can be used.
!* Added new user function CheckValidName(pName$). Scans the
! string parameter and returns zero if it does not contain
! any of the nine characters not allowed in file names.
! Returns a value of one if any invalid characters are found
! after displaying a message stating:
! .----------------------------------------------------------------.
! | Invalid Character ('x') in file name. |
! | |
! | A file name can't contain any of the following characters |
! | \ / : * ? " < > |
! '----------------------------------------------------------------'
!* Minor changes to the GraphicControlsTestBed.bas, Temperature.bas
! and Calculator.bas sample source files.
!* Reworked "ExpenseTracker" sample source. Place ExpenseTracker.bas
! in the source folder. Place ExpensesHelp.txt, FormatingHelp.txt
! and Expenses.png in the data folder. Run the program and select
! the menu option "Help" for a brief guide to the reworked program.
!* Added new sample program "PictureTimeLine.bas". Program can be
! used organise and document picture collection(s).
! Place PictureTimeLine.bas and PictureTimeLineExifData.bas in the
! source folder. Place PictureTimeLineHelp.txt and TimeLine.png in
! the data folder. Run the program and select the menu option "Help"
! for a brief guide to the new program.
! Note: This is a beta version and still has a couple of routines
! missing but it does demonstrate many of the new control features.

 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Thu May 29, 2014 5:33 pm 

Joined: Tue May 20, 2014 7:27 pm
Posts: 3

First time poster, new user of RFO Basic! but user of other Basics.

I downloaded the directories at ... cControls/ and had some problems in running some of the examples.

GraphicControlsTestBed.bas runs for a while loading the screen and loads a screen that looks like similar to the screenshot_GraphicControlsTestBed.png except that the picture of cartman is missing and then goes very quickly to an error report:-

"Display List had deleted bitmap


which points to rc=DrawForm("Loading Test Form...", picPath$)

I've tried downloading the directories a number of times in case I'm missing any of the files.

FoodManager.bas tells me that "android.database.sqlite.SQLiteException: no such table etc...."

Both GCKeyBoard files show:-

"Syntax Error"

Am I doing anything wrong? Are there other include files that are needed?

Thanks for any help.



 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Fri May 30, 2014 7:09 am 

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
Thank for bugs report.

Still investigating / checking things but in the meantime some quick answers to your problems.

I thought the cartman.png picture was installed in the Basic Data folder when Basic was installed as it is used by one or more of the sample programs which is why I used it. Any (small png) picture renamed to cartman.png should work as there is nothing special about the picture.

The Food Manager program comes with 4 sample text files (Categories, Products, Shops and Options) which use a special character to separate fields within a line of text. Unfortunately, at some point these special characters got altered (possibly changed from 8 bit characters to 16 bit characters). This prevents the program from splitting lines into field arrays when trying to create the Food Manager database. Not touched the Food Manager program for some time but I will re-upload it together with (I hope) 4 corrected text files. Make sure the two Food Manger Database files in the Basic Databases folder are deleted (if present) before re-running the program.

Again, not touched the GCKeyboard files for ages. They were done more as a stand alone proof of concept and I think the KB.SHOW command has since been changed to KB.TOGGLE. The resulting keyboard code was incorporated into the GraphicControls.bas so unless a stand alone keyboard routine is required the keyboard files are not needed. Maybe they should be deleted along with some of the other test files.

Hope this helps. As I said earlier I will try and upload corrected code files asap.

 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Fri May 30, 2014 6:44 pm 

Joined: Tue May 20, 2014 7:27 pm
Posts: 3
Hello Jeff

Thanks for your reply. I checked and I do have cartman.png in the data folder. I actually went through and changed every occurence of cartman.png in the source to another graphic in case it was upsetting the apple cart for some reason.

I've attached a screen cap of what I see before it falls over and a screen cap from the cover of your manual. They look pretty much the same except for the cartman area and the 'Predefined Colours' area which is missing the colours.

I'm going to work on doing some simple examples and see where that goes.



tmp_Screenshot_2014-05-31-11-09-02-538014883.png [ 216.04 KiB | Viewed 2002 times ]
tmp_Screenshot_2014-05-31-09-53-08-1835782378.png [ 107.58 KiB | Viewed 2002 times ]
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Sat May 31, 2014 2:07 am 

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
I assumed it was just a case of a missing picture file without actually running a test.
When I run the Test Bed program I don't get an error but I do get a small (actual size) cartman drawn centered in the picture area. This is caused by the introduction of the "bcPICSIZE$" style. Only if this style is specified will the bitmap resize to fit the picture area.
I will upload the current versions of the various Graphic Controls files so at least we are running the same version of the programs and see if that makes a difference.

 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Sat May 31, 2014 3:23 am 

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
Just uploaded new versions of the Graphic Controls and some of the sample programs. See below for details.
Please report any bugs and/or suggestions.

!Graphic Controls v1.13 Changes
!* Fixed bug - Vertical scroll bar with no border drawn incorrectly.
!* Fixed bug - Combobox List misplaced above control when
!  number of entries less than 10 and vertical scroll bar slider not
!  drawn correctly.
!* Fixed bug - Vertical scroll bar not updated when AddListRow
!  or DeleteListRow used with non-displayed rows.
!* Fixed bug - New Button draw routines broke ModCtrlCapBakCol()
!  function (button background graphic object not saved).
!* Changed colour used for combobox/menu break lines from caption
!  background colour to caption text colour.
!* Added 4 new functions ModCapBakAlpha, ModCapTxtAlpha,
!  ModDatBakAlpha and ModDatTxtAlpha to enable the Alpha
!  property to be set. All 4 use the same set of parameters.
!  e.g.: ModCapBakAlpha(pCtrlNo,pAlpha,pRender) where:
!        pCtrlNo = Ctrl Number to be altered.
!        pAlpha = Alpha Value to be set (value range 0 to 255).
!        pRender = 0 or 1. Set to 1 if a Render is to be performed
!                          after the update.
!  Note: This is not a permanent change to the control style and the
!  effect will need to be re-applied if the control is updated/redrawn.
!* Added new style "bcOUTLINE$". Applies to Label controls only and
!  causes a black border to be draw round all characters in Label text.
!* Added new style "bcNOSCROLL$". Applies to Listbox controls only and
!  suppresses the drawing of the vertical scroll thus allowing the full
!  width of the Listbox control to be used for text. Usefull when
!  Multiline Listbox style is used to display messages.
!* Added new style "bcNOBACK$". Applies to Listbox controls only and
!  suppresses the drawing of the Data area background so that the form
!  or Frame background shows through. Usefull for example when a
!  multiline ListBox is drawn on a picture to display a message and the
!  picture background is to appear behind the Listbox text.
!  Files Changed:
!  -------------
!  - GraphicControls.bas   - Copy to Basic Source folder
!  - GraphicConstants.bas  - Copy to Basic Source folder
!Graphic Controls Test Bed v1.13 Changes
!* Added bcPICSIZE$ style to cartman picture control. Picture now scaled to fill
!  picture area.
!* Added "About" option to main Menu.
!  Files Changed:
!  -------------
!  - GraphicControlsTestBed.bas   - Copy to Basic Source folder
!FoodManager v2.01 Changes
!* Changed field Delimiters in the 4 sample text files to bcCOLBREAK$ (using encoding)
!* Added "bcPICSIZE$" to pictures controls
!* Changed GetCtrlXY() to GetCtrlClickXY()
!  Files Changed:
!  -------------
!  - FoodManager.bas       - Copy to Basic Source folder
!    + SampleCats.txt      - Copy to Basic Data/FoodManagerData folder
!    + SampleOptions.txt   - Copy to Basic Data/FoodManagerData folder
!    + SampleProds.txt     - Copy to Basic Data/FoodManagerData folder
!    + SampleShops.txt     - Copy to Basic Data/FoodManagerData folder
!PictureTimeLine v2.00 Changes
!* Added DBName to Backup Filename.
!* Fixed Bugs in Header Create/Update routine.
!* Correct combobox lists on Picture Selection form.
!* Allow Blank or specific date rule on Picture Selection form.
!* Added Not Equal condition for Status, Album and Event fields
!  on Picture Selection form.
!* Database Integrity - Delete action coded.
!* Database Integrity - Create icon coded.
!* Database Integrity - Register picture coded.
!* Date/Time now set on Import.
!* Added Merge function to Database functions.
!  Will merge Name Group, Name and Picture data from a TimeLine
!  Backupd file into the current Database. Data will not be
!  merged if the item already exists or, in the case of Names,
!  the Name Group does not exist.
!* Added Merge Name Data only. As above but does not merge picture data.
!* Added warnings if updates not saved.
!* Fixed Name Group selection on Edit Names Form.
!* Fixed Edit - Paste values from another existing picture
!* Fixed bug with PasteAll - wrong variable name used.
!* Small change to picture search form layout
!* Corrected search rule format when first row of Search Rule store deleted.
!* Added Slide Show Manual mode.
!* Added Status Maintenance option to Settings Page.
!* Changed name of folder containing Pictures from "Pictures740" to just "Pictures".
!  Files Changed:
!  -------------
!  - PictureTimeLine.bas   - Copy to Basic Source folder
!  - PictureTimeLineHelp.txt - Copy to Basic Data folder
!    +        - New File. Unpack (using ES File manager or similar)
!                            onto device. Result should be a Folder called TestPics
!                            containing two subfolders called Pictures and Thumbnails.
!                            Each of these subfolders should contain 18 pictures.
!  To use test pictures do the following:
!  * Start program. "Add" new Database-Picture Folder combination.
!  * Enter new Name (eg: TestDB) for Database.
!  * Select the TestPics folder containing the two sub-folders as picture source.
!  * Select created Database-Picture Folder entry.
!  * Select Database Operations then Register Pictures.             
!  Once pictures have been registered use Picture Operations selection to
!  select pictures to be worked on (eg: Selection Rule "Status = Blank" will
!  select all 18 pictures). 

 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Sun Jun 01, 2014 3:23 pm 

Joined: Tue May 20, 2014 7:27 pm
Posts: 3
Hi Jeff

That's fixed it all up, many thanks. Now I'll sit down and work out what everything does :).




Played around a bit more:-

Date Control doesn't seem to be scaled properly when called. (Screenshot attached) Can't exit out without stopping program.

Using the FrmString control causes the program to crash (no opportunity to input text):-

"No bitmap found

Also the button on the FrmText causes the same reaction. Touching the other two areas of the control works fine.

Everything else seems to be working ok.



Screenshot_2014-06-04-11-55-28.png [ 92.94 KiB | Viewed 1854 times ]
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Sat Aug 02, 2014 4:36 am 

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
Just uploaded a new version of the Graphic Controls (v1.14). Only 4 files uploaded (GraphicControls.bas, GraphicConstants.bas, GraphicControlsTestbed.bas and a new file GC-QuickRef.pdf).

Not sure if anybody is running the Expenses and PictureTimeLine programs as the previous versions either did not work or had quick a few bugs and yet I received no feedback but just in case anybody is interested I have updated versions of these programs I will upload if requested. They are not perfect but as of this moment they contain "no known bugs" (this just means I have not found them yet!).

I would like to fix all the bugs in these programs but testing the code takes a really long time so any bugs reports or suggestions would be gratefully received.

I was thinking of changing some of the commands to simplify coding. For example the two commands EnableCtrl and DisableCtrl could be replaced by one command with a flag indicating the required state. The same logic could be applied to the Show and Hide commands. Would this impact anybody?


!Graphic Controls v1.14 Changes
!* Fixed Bug - Cursor Position on Graphic Keyboard panel wrong after font size changed during a GR.REFRESH.
!* Fixed bug - Normalise Graphic Keyboard function now sets input string to lowercase before starting the
!  normalise operation.
!* Fixed Bug - Disabling entries in a Menu Dropdown List was not working properly. Also changed appearance
!  of disabled entries (they are drawn semi-opaque with "¬" sign removed) and any clicks on disabled items
!  are ignored.
!* Fixed Bug - bcFRMTEXT control not being processed correctly. Also changed separator character between
!  Text Title and Text Body from bcRECBREAK$ to bcFLDBREAK$ as bcRECBREAK$ could cause problems when
!  splitting strings into records when using bcRECBREAK$ as the record separator.
!* Fixed Bug - Graphic Keyboard could appear behind control(s) if they were created after the first use of
!  the keyboard on a form.
!* Change. Replaced the four functions ModCapBakAlpha, ModCapTxtAlpha, ModDatBakAlpha and ModDatTxtAlpha with
!  four new functions ModCapTxtObj, ModCapBakObj, ModDatTxtObj and ModDatBakObj.
!  These four new functions all use the same parameter list:
!        ModCapTxtObj(CtrlNo,Tag$,Value,Render)
!        Where: CtrlNo is the number of the control to be changed.
!               Tag$ is the name of the object property to be changed (eg: "x", "alpha", etc. Tags names are
!                    the same as those used in the GR.MODIFY command).
!               Value is the new Tag value (eg: A number between 0 and 255 for "alpha" Tag).
!               Render indicates whether a GR.RENDER is to be performed after the change ("0"=No, "1"=Yes).
!* Change to DrawForm "Popup Message" parameter. If set to "HG" then instead of a PopUp message being
!  displayed, an hourglass is shown while the form is being drawn.
!* Change to ComboBox Caption & Data. The Caption string for each entry in the drop down list can now
!  optionally contain additional data. The bcCOLBREAK$ character is used to seperate this additional data
!  from the displayed portion of the list entry. The additional data string can be any format/length as
!  long as it does not contain the bcRECBREAK$ character. When additional data is present the GetCtrlData$
!  function will return the original caption version of the selected entry with both the displayed entry
!  and the additional data string.
!  Eg: Normal Caption with No Additional Data: "Menu"+bcRECBREAK$+"Help" ~
!                                                    +bcRECBREAK$+"About"
!               - Dropdown List Displays "Help" and "About".
!               - GetCtrlData$ returns "Help" or "About".
!      New style Caption With Additional Data: "Menu"+bcRECBREAK$+"Help"+bcCOLBREAK$+"AAA" ~
!                                                    +bcRECBREAK$+"About"+bcCOLBREAK$+"BBB"
!               - Dropdown List Displays "Help" and "About" as before.
!               - GetCtrlData$ returns "Help"+bcCOLBREAK$+"AAA" or "About"+bcCOLBREAK$+"BBB"
!* Changed Graphic Keyboard "Select" control from an Option Button to a normal button.
!* Changed predefined bcGREEN and bcYELLOW to a darker version of the colours.
!* Added new function "setMBTypeClrs(pType$)" for use with Message Box control. Sets the colours to be
!  used when a Message Box is next displayed. Value of pType$ parameter ("I", "Q", "E" or "C") determines
!  which colour set is the be used. Values stand for (I)nformation, (Q)uestion, (E)xclamation and
!  (C)ritical.
!* Added new user function SetHourGlass [ SetHourGlass("Y"/"N") ]. Turns DrawForm Hourglass display
!  on/off as it is not always required on faster machines.
!* Added new control style "bcDATABORDER$=">". Results in border round a control only be drawn round the
!  data section of a control. eg:
!       .--------------------.                                  .---------.
!       | Caption | Data    |  changes to   Caption | Data    |  when "bcDATABORDER$" style applied.
!       '--------------------'                                  '---------'
!  If the caption background colour is the same as that of the form colour only the caption text will display.
!  Can be used with other styles (eg: bc3DBORDER$, etc). Note: bcNOBORDER$ style takes priority if present.
!* Reworked Graphic Keyboard input processing. Added Shift and Caps Lock Buttons to Graphic Keyboard panel.
!  Attempted to change input so it works with (my) external keyboard. Shift, either on Graphic Keyboard or
!  from an external keyboard, works like an Andriod virtual keyboard. Press/release shift key then press
!  the key where the shifted value is required.
!  Routine is still not perfect as it still does not work will all keys on some keyboards.
!  Added a user function 'CALL LoadKBDKeyVal(param$)'. IF 'param$' is set to "UK" it will alter the shifted
!  values of the '2','3' and "'" keys from '@', '#' and '"' to '"', '�' and '@'. Works on my Samsung Laptop
!  running with a 'UK' keyboard and 'Bluestacks'.
!  Possible enhancement would be to implement an 'Alt' key so accented characters can be entered.
!* Various cosmetic changes.
!* Added a 4 page "Graphic Controls Reference Card" PDF containing details of all the commands and constants used !  by Graphic Controls. Layout is similar
!  to the "Commands" menu option in Basic.

 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Sat Aug 09, 2014 2:19 am 

Joined: Mon Aug 04, 2014 9:58 am
Posts: 3
**Post deleted by author** Double Post !

Last edited by doogle on Sat Aug 09, 2014 2:33 am, edited 1 time in total.

 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Sat Aug 09, 2014 2:19 am 

Joined: Mon Aug 04, 2014 9:58 am
Posts: 3
I am having the same probem as Grumpy; running the Testbed and my own code, clicking on a "string" control results in:

No bitmp found

and the application dies.
I am using version 1.14

Also, the single quote on my external keyborard has turned into a comma. I guess it may be to do ith the recent changes and I should identify the keyboard as "UK" (?)

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 129 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13  Next

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: