Some Modules

klaus

Expert
Licensed User
Longtime User
Here are some general modules included in a test program.
- Setup language choice, prompt before exit, default folder
- FileChooser file chooser based on Erel's FolderChooser and an improvement of specci48
- ColorPalette from the IconEdit program
- About form
- RPNCalc Reverse Polish Notation calculator
- Draw Bitmap drawing program

I added a seperate folder for each module with all files needed for it.

Hope these could be usefull, and best regards.

EDIT: 2009.02.04 Improved Setup and FileChooser modules.

EDIT: 2009.03.14 Added Draw module
 

Attachments

  • TestModulesV1_2.zip
    339.6 KB · Views: 440
  • About.zip
    848 bytes · Views: 422
  • ColorPalette.zip
    51.2 KB · Views: 396
  • Draw.zip
    240.1 KB · Views: 403
  • FileChooser.zip
    5.4 KB · Views: 444
  • RPNCalc.zip
    9.6 KB · Views: 372
  • Setup.zip
    5.9 KB · Views: 388
Last edited:

manu

Active Member
Licensed User
Longtime User
thanks Klaus

very good examples, it is very difficult to absorb everything that goes in the forum every day, here is a marvel

best regards
 

derez

Expert
Licensed User
Longtime User
Thanks Klaus
I used the color selection module in my navigation program, to enable the user to select the colors of route points, lines etc.
The integration was very easy :)

I had a problem that forelayer erased area done with FErase command became White instead of transparent, after doing color selection. I solved it by using

B4X:
SetTransparentColor (cWhite) 
forrm5.ForeLayer = True

at the end of "Public Sub ReturnColorPalette(col)"
 

klaus

Expert
Licensed User
Longtime User
Hi derez,

I am glad to hear that this module is helpfull for others.

I don't really understand the problem you had with the transparency color.

I use transpareny in some of my programs, but I didn't need to add the two lines you mention.

I tested it also on a second form without the need of the two lines.

Did you declare the transparency color in AppStart before the Form.Forelayer=True and Form.Show lines?
B4X:
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]App_Start[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] SetTransparentColor[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] ([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]cWhite[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New] frmTest.ForeLayer=[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]True[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] Sip[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]False[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
[SIZE=2][FONT=Courier New] frmMain.Show[/FONT][/SIZE][/SIZE][/FONT]

Best regards.
 

derez

Expert
Licensed User
Longtime User
Did you declare the transparency color in AppStart before the Form.Forelayer=True and Form.Show lines?

Before the addition of the module I had only the Form.Forelayer=True.
The addition of settransparency there did not change the situation - I understand that the selection of color changes the transparency color, so I had to write it again for white after the color selection.

When I retry this again, compiling with my Laptop instead of the Desktop, the problem does not occure even without the settransparency, so there is probably some older version of something in my Desktop....

Anyway, when I check the global definitions of the module, I see that settransparency is defined with color closer to white - RGB(250,250,250),
Is there a reason for it ? may be this is causing the problem :confused:.
 

klaus

Expert
Licensed User
Longtime User
Hi derez,

I still don't know why you needed to declate the transparent color again when coming back from the ColorPalette.

Attached is a modifyed version of the TestModule program.
There is a new button called 'Draw Test', a click on this button shows a new Form, 'frmTest' with cWhite as transparent color, declared at the beginning of the AppStart routine.
On this form you can draw lines, point - move - release. During move a red line is drawn on the forelayer.
From this form you can call the ColorPalette (with RGB(250,250,250) transparent color) and choose another color, and also White and it works, without setting the transparent color for the 'frmTest' form again.

I choose the transparent color for the ColorPaltte to RGB(250,250,250) to be able to use the true white color also on the forelayer. RGB(250,250,250) looks like white but is not white.

Best regards.
 

Attachments

  • TestModules1.sbp
    5 KB · Views: 291
Last edited:

moster67

Expert
Licensed User
Longtime User
Great stuff !

Thank you Klaus

rgds,
moster67
 
Top