|
Post by Walt Decker on Jun 19, 2021 12:44:24 GMT -5
This is set up on a pseudo-mdi (multi-document interface) format. I has various tools, line primitives, a color mixer and palette, tool tips for the tools and line primitives, and more. For conveince I have included an installer.
The zip file includes necessary dlls, bitmaps, IMAGE_EDIT_INFO.txt, installer, and source code. Enjoy.
|
|
|
Post by honkytonk on Jun 20, 2021 3:06:45 GMT -5
To compress a project, you have to put it in a folder and compress the folder, otherwise everything gets scattered in bulk in the decompressor's destination folder, which can contain other things, causing a big messy mix.
|
|
|
Post by Rod on Jun 20, 2021 5:03:08 GMT -5
Yes, the neatest way is to put everything your project needs inside a folder then zip that folder. You can have subfolders within the main project folder. In your code always use relative paths that point to folders within your project folder.
Now the user can unzip the folder and keep everything contained, they can choose to unzip it anywhere c:, d: temp\, anywhere.
I am quite happy to explore .bas .tkn and even .exe files if they are shipped this way. I am unlikely to "instal" any code since this can add stuff to my PC that I may use only once and might use resource for ever more.
With the project folder I know that by deleteing it I am cleaning my PC completely.
|
|
|
Post by honkytonk on Jun 20, 2021 5:34:47 GMT -5
It seems that the function: "REPLSTR$()" is missing.(with LB 4.4) And with LB 4.5: "error handle close: "#DRW"; #NUM; #USER"
|
|
|
Post by Walt Decker on Jun 20, 2021 10:09:06 GMT -5
I see what you are talking about. My decompressor just added some empty folders. My decompressor decompressed the files in a folder of my choosing. Did not yours?
Did you look at IMAGE_EDIT_INFO.txt? Right at the top it explains what the installer does.
As far as a missing REPLSTR$() nothing I can do about that. It is in LB PRO. And where are you getting "error handle close: "#DRW"; #NUM; #USER"?
|
|
|
Post by honkytonk on Jun 20, 2021 11:34:41 GMT -5
Well yes, after being invaded, I decompressed in a dedicated folder. Questions: Why did you put a "_" after the "." in the file name: ".bas"? Why not have placed the: ".bmp" in a folder? Why did you code with LB Pro? What does this bring that LB 4.4; 4.5; or LB5 cannot do? Why not have loaded and processed all: ".bmp" in a loop?
|
|
|
Post by Walt Decker on Jun 20, 2021 11:45:40 GMT -5
If your version of LB does not support function REPLSTR$() here is a patch:
' FUNCTION FN.Replace$(Txt$, Remove$, Insert$)
RemLen = 0 InLen = 0 RepPos = 0
A$ = "" B$ = "" C$ = ""
A$ = Txt$
RemLen = LEN(Remove$) InLen = LEN(Insert$)
[BEGIN.REPLACE] RepPos = INSTR(A$, Remove$)
IF RepPos < 1 THEN GOTO [END.REPLACE]
B$ = LEFT$(A$, RepPos - 1) C$ = MID$(A$, RepPos + RemLen) A$ = B$ + Insert$ + C$ GOTO [BEGIN.REPLACE]
[END.REPLACE]
FN.Replace$ = A$ END FUNCTION '
1: Insert the patch at the end of the source code.
2: Replace FntStr$ = REPLSTR$(Font$, " ", "|") with FntStr$ = FN.Replace$(Font$, " ", "|")
3: Replace Font$ = REPLSTR$(Font$, "_", " ") with Font$ = FN.Replace$(Font$, "_", " ")
|
|
|
Post by Walt Decker on Jun 20, 2021 11:59:21 GMT -5
Well yes, after being invaded, I decompressed in a dedicated folder. Questions: Why did you put a "_" after the "." in the file name: ".bas"? Why not have placed the: ".bmp" in a folder? Why did you code with LB Pro? What does this bring that LB 4.4; 4.5; or LB5 cannot do? Why not have loaded and processed all: ".bmp" in a loop? 1: What do you mean by "invaded"? The zip file should not have invaded you in any way.
2: Two reasons: 1) I have other basic dialects, 2) It is my perrogative to do so.
3: The bmp files get put in \RESOURCE directory by the setup routine.
4: I have LB 4.5.1 PRO. I do not have LB5 since it is its infancy. I have enough problems with LB 4.5.1 PRO because it always locks up with a runtime error it does not know how to handle.
5. What do you mean by loading and processing "all bmp files in a loop?" To which ones are you referring and in what part of the code are you referring?
|
|
|
Post by Rod on Jun 20, 2021 14:00:37 GMT -5
I have been caught out before. If you are not aware and just unzip a set of files that are not contained in a folder they intersperse themselves into the current folder and can be problematic to remove unless they are well named. So containing everything in a project folder protects users from this mistake.
I thought the _ was about passing mail checkers, some balk at passing .exe or even .bas files and occasionally they need renamed to something less innocous like .dat However the _ does put a hurdle in the way of new users or beginners.
I think there are far fewer user of Pro than v4.5 The .tkn and .exe will only run with Pro support files so you limit your audience. However a simple .bas will let anybody try your program aside from commands not implimented. Distributing the .bas and any dedictated .dll files will gather the widest audience.
|
|
|
Post by tsh73 on Jun 20, 2021 17:29:03 GMT -5
(LB 4.5.1 on Windows XP) my experience Tried to execute setup file First it tried to open DLLS from hardcoded path OPEN "E:\PBWIN10\DLLS\FN_dir" FOR DLL AS #DIR OPEN "E:\PBWIN10\DLLS\DbFetch" FOR DLL AS #FETCH
Then it happened that ZIP file does not contain DbFetch.DLL ;( After attempting to do setup stuff by hand (as described), program error on this line OPEN "DbFetch" FOR DLL AS #FETCH Runtime error: Не найден указанный модуль. /Module not found/ ( OS error 16r7E ) Needs same DLL, apparently After some googling found it here on LB forum Got DbFetch.dll from this thread libertybasiccom.proboards.com/thread/1595/sprites-tilesNow it says FN_LoadImage could not find C:\Temp\IMAGE_EDIT\RESOURCES\FREEHAND.BMP; file missing I see path is correct and file is there. Debugging I see that actually paths start with spaces so I change RESOURCE = C:\Temp\IMAGE_EDIT\RESOURCES to RESOURCE =C:\Temp\IMAGE_EDIT\RESOURCES After that it run and created bunch of PAL files (as promised) so I tried to actually use it After that I did Files/new project Canvas/new File\load image (lasso from RESOURCES) TOOLS\show toolbar TOOLS\show palette selected paint brush - and cursor is stuck in this mode no menu items seem to work, no close button either killed it with ProcessExplorer. Second try new project new canvas I opened mixer, changed color, see it in palette opened shapes and tools after I press on a tool (now a pen) I cannot pick another tool, cursor stays pen. Again no exit, had to kill application. My setup may be weird, and writing compatible programs looks to be hard. (as they said, "You can make a program you can run on your computer. To change it so you can run it on any computer takes 3x time. To change it so anyone could run it on it's own computer takes another 3x time" ) Third try created project oopened new canvas saved project closed app by close buuton See file in Projects folder C:\Temp\IMAGE_EDIT\PROJECTS PROJECT = PROJECTS\test3.PRJ .<PROJ PARAMS>. COLORS = PALETTES\test3.PAL SPRITE PATH = SPRITES\test3 NUM SPRITES = 0 SPRITE WIDE = 32 SPRITE HIGH = 64 .<END PROJ PARAMS>. .<NAMES>. 0SPR,0SPR .<END NAMES>.
However, on next run - load projects - no projects found (
|
|
|
Post by Rod on Jun 21, 2021 2:33:55 GMT -5
Most of this would have been caught if the program had been created inside its own folder. Paths would have been correct and if all .dll had been included it would have found all off the needed resources. By using relative paths instead of hard coded paths you can include bmp and sub project folders that can be found no matter where the user chooses to unpack the project.
Testing the program inside its project folder proves that it will work on any PC. .dll is a discipline thing, I usually always include what is needed and don’t rely on the user having a copy.
|
|
|
Post by Walt Decker on Jun 21, 2021 4:55:25 GMT -5
Thank you. You have given me something with which to work. Since you did it by hand, there appears to be something wrong in the configuration file. The projects file gets it's information from the configuration file. Can you show me what IMAGE_EDIT.CFG looks like? When you were drawing on a canvas, did you get an image? Before exiting a drawing action did you click the RIGHT MOUSE BUTTON while on the canvas? When hovering over a tool or shape after completing a drawing action, did a tool tip appear? If not, you were still in drawing mode. Sorry about the hard coding in the setup file. I had taken them out of the image_edit file and forgot the setup. Also, I thought I had all the dlls. Going blind is not any fun.
Thank you for going the extra mile.
I have revised the info.txt file to provide more information and examples of what the various directories should contain and what the files should look like. I have also included a patch for the REPLSTR$() function.
|
|
|
Post by tsh73 on Jun 22, 2021 13:56:53 GMT -5
Hello Walt Since you did it by hand, there appears to be something wrong in the configuration file. The projects file gets it's information from the configuration file. Can you show me what IMAGE_EDIT.CFG looks like? When you were drawing on a canvas, did you get an image? Before exiting a drawing action did you click the RIGHT MOUSE BUTTON while on the canvas? When hovering over a tool or shape after completing a drawing action, did a tool tip appear? If not, you were still in drawing mode. Sorry about the hard coding in the setup file. I had taken them out of the image_edit file and forgot the setup. Also, I thought I had all the dlls. Going blind is not any fun. Thank you for going the extra mile. I have revised the info.txt file to provide more information and examples of what the various directories should contain and what the files should look like. I have also included a patch for the REPLSTR$() function. IMAGE_EDIT.CFG is attached below IMAGE_EDIT.CFG (797 B) I did get something drawn from a paintbrush and I kept getting rectangles from pencil - it never occurred for me to read the intruction MORE No. This is really impossible to guess. Had to READ MANUAL... Yes I saw lot's of nice tooltips As for I believe this function was added in LB 4.5.1 Previous version - LB 4.0.4 - had no such function Since new LB picks up old license (I believe), there no reason not to use newer LB. (unless you absolutely have to) (though again I keep both JB 1.01 and 2.0, even if 2.0 can all AND something of JB 1.01)
|
|
|
Post by Walt Decker on Jun 22, 2021 15:04:53 GMT -5
LOL! That is what they are for.
The top part of the cfg should look like the following. All paths must be fully qualified. LAST PROJECT =C:\Temp\IMAGE_EDIT\PROJECTS\test3.PRJ .<PATHS>. EXEPATH =C:\Temp\IMAGE_EDIT\CONFIG CFGNAME =C:\Temp\IMAGE_EDIT\CONFIG\IMAGE_EDIT.CFG RESOURCE =C:\Temp\IMAGE_EDIT\RESOURCES PRJPATH =C:\Temp\IMAGE_EDIT\PROJECTS SPRITE PATH =C:\Temp\IMAGE_EDIT\SPRITES COLORS =C:\Temp\IMAGE_EDIT\PALETTES .<END PATHS>.
The project file should look like this: PROJECT = C:\Temp\IMAGE_EDIT\PROJECTS\test3.PRJ .<PROJ PARAMS>. COLORS = C:\Temp\IMAGE_EDIT\PALETTES\test3.PAL SPRITE PATH = C:\Temp\IMAGE_EDIT\SPRITES\test3 NUM SPRITES = 0 SPRITE WIDE = 128 SPRITE HIGH = 96 .<END PROJ PARAMS>. .<NAMES>. 0SPR,0SPR .<END NAMES>.
In C:\Temp\IMAGE_EDIT\PALETTES you should have a file titled "test3.PAL". In test3.PAL you should have a list of numbers, each list containing 1 to 3 digits separated by spaces, e.g. 255 128 64 0 255 255
In C:\Temp\IMAGE_EDIT\SPRITES\test3 you should have one file titled 0SPR.SPR
Once again, I thank you for going the extra mile. It really helps.
|
|