File/script editor - page 2 - General Discussion and Assistance - CHDK Forum
supplierdeeply

File/script editor

  • 15 Replies
  • 6140 Views
*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: File/script editor
« Reply #10 on: 27 / July / 2008, 11:48:12 »
Advertisements
Quote
Next step is to implement the actual writing of the file. Any comments/suggestions welcome!

Hi Wontolla, this project seems very interesting and really would like to see it completed. Can I help in any way? Do you need the file-write part done ?

I know i am bothering you, but I do it on purpose :-) so that you don't forget this good project of yours, it seems you did most of the work already!!

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: File/script editor
« Reply #11 on: 27 / July / 2008, 13:50:06 »
No bothering of course!

My problem is I am lazy (look at my avatar) and I always need somebody to wake me up so I go back to work.

You are right, the editor is almost done, at least the basic implementation.

In fact, tomorrow I have a meeting with my advisor. Depending on his mood, if I can trick him into believe I've been doing good work, he will be happy and I can dedicate some time next week to CHDK.

Otherwise, I'll organize the code and comment it so you can finish.

Thanks for offering your help!

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: File/script editor
« Reply #12 on: 28 / July / 2008, 00:08:19 »
wonderful, thanks!

*

Offline lumin

  • *
  • 1
  • A620
Re: File/script editor
« Reply #13 on: 04 / October / 2008, 12:31:07 »
I would love to see this finished.

Any word on progress?


*

Offline frank

  • *
  • 23
Re: File/script editor
« Reply #14 on: 05 / October / 2008, 05:12:45 »
I can't download the gui_read.c file
Please make it work, wontolla!
Camera: A570IS      Firmware: 1.01a

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: File/script editor
« Reply #15 on: 05 / October / 2008, 14:21:16 »
Quote
I can't download the gui_read.c file

Sorry for the death link, here is a new one. One of these days I will pay for hosting instead of using these free sites that erase your files from time to time.

http://wontolla.freehostia.com/CHDK/FileEditor/gui_read.c

And the video that explains the keyboard usage, similar to iPods. (so I guess, because I don't have one).

http://wontolla.freehostia.com/CHDK/FileEditor/MQwerty.flv


The code is fairly commented and most of my changes are between lines in the form: Begin Wontolla's mess...End Wontolla's mess
But you don't really need to understand or change what I did. All my functions are just to draw here and there on the screen and control the buttons. You should focus at the end, in the main switch for this feature to be completed. I marked the places where the code to actually write on a file should be added. For example:

Code: (c) [Select]
gui_read_draw_keyboard_square(square, COLOUR_CENTER, page, key);
                    //DISPLAY CHARACTER
                    stage = 2;
                }
                else if (stage==2) {
                    //WRITE CHARACTER
                    gui_read_draw_keyboard_section(state, black, page);
                    state=left;
                    qui_read_draw_button_margin(left, COLOUR_SELECTED);
                    gui_read_draw_keyboard_section(left, coloured, page);
                    key=0;
                    stage = 1;

Where the //WRITE CHARACTER comment must be replaced by the code that writes the present character to the file, using the standard I/O C code functions like fopen, fwrite etc.

I recommend adding some code to create a new file and write on it first. Then, move to the modification of an existing file and insert/erase/modify in any place on that file. Unfortunately, nowadays I don't have time to work on this. Sadly, not even to go out and take pictures. But I hope one of you guys find the way to finish this feature as it will be useful for all those CHDK script writers out there.

I will happily answer any questions about the code etc.

Have fun!

 

Related Topics