WordPad clone source

Share your advanced PureBasic knowledge/code with the community.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4790
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: WordPad clone source

Post by Fangbeast »

2. Cannot get checkboxes, optionsboxes to be transparent. Went through working code of mine where it worked and too tired to spot the differences.
Finally fixed number 2. D'oh! I have a void in my brain where the used sheep used to be.

Incorporated it into SerialMuncher as well. YAY! Will upload the changes tonight if I haven't broken anything else. Right now, It's too warm in here to code.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4790
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: WordPad clone source

Post by Fangbeast »

Read the first post for updated info and let me know if the link doesn't work
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
infratec
Always Here
Always Here
Posts: 7622
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: WordPad clone source

Post by infratec »

Hi,

the menu entry for Search is not working in the latest 7z.

Code: Select all

Case #MenuBar_Search
Should be

Code: Select all

Case #MenuBar_SearchText
Bernd
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: WordPad clone source

Post by davido »

@Fangbeast,
I always use the latest version of PureBasic, 5.31 x64. So it crashed!
Should have realised you wrote it for previous versions.
Discovered that the problem was with the redundant packer JCALG1.
I just crudely commented lines: 48-54, 66 and 606-616. in _OwnerdrawComboIconsFonts.pbi
Seems to work fine with PB5.31 x64. doesn't seem to be a problem with the missing image.

@infratec,
Had the same problem with Search. Thanks for the solution.
DE AA EB
infratec
Always Here
Always Here
Posts: 7622
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: WordPad clone source

Post by infratec »

Hi,

use this:

Code: Select all

DataSection
  FontType: 
  Data.a  $42, $4D, $96, $01, $00, $00, $00, $00, $00, $00, $76, $00, $00, $00, $28, $00
  Data.a  $00, $00, $30, $00, $00, $00, $0C, $00, $00, $00, $01, $00, $04, $00, $00, $00
  Data.a  $00, $00, $20, $01, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
  Data.a  $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $80, $00, $00, $80
  Data.a  $00, $00, $00, $80, $80, $00, $80, $00, $00, $00, $80, $00, $80, $00, $80, $80
  Data.a  $00, $00, $80, $80, $80, $00, $C0, $C0, $C0, $00, $00, $00, $FF, $00, $00, $FF
  Data.a  $00, $00, $00, $FF, $FF, $00, $FF, $00, $00, $00, $FF, $00, $FF, $00, $FF, $FF
  Data.a  $00, $00, $FF, $FF, $FF, $00, $BB, $BB, $BB, $BB, $55, $55, $55, $BB, $BB, $BB
  Data.a  $B8, $77, $7B, $BB, $BB, $BB, $BB, $B9, $99, $7B, $B9, $97, $BB, $BB, $BB, $BB
  Data.a  $BB, $BB, $BB, $55, $BB, $BB, $BB, $BB, $70, $88, $86, $8B, $BB, $BB, $BB, $99
  Data.a  $99, $97, $99, $79, $BB, $BB, $BB, $BB, $BB, $BB, $BB, $55, $BB, $BB, $BB, $B8
  Data.a  $00, $BB, $B8, $68, $BB, $BB, $BB, $99, $7B, $79, $99, $B7, $9B, $BB, $BB, $BB
  Data.a  $66, $66, $66, $55, $BB, $BB, $BB, $B8, $00, $BB, $BB, $76, $8B, $BB, $BB, $99
  Data.a  $7B, $B7, $99, $7B, $BB, $BB, $BB, $BB, $BB, $66, $BB, $55, $BB, $BB, $BB, $B8
  Data.a  $00, $BB, $BB, $86, $6B, $BB, $BB, $99, $7B, $BB, $79, $9B, $BB, $BB, $BB, $BB
  Data.a  $BB, $65, $BB, $55, $BB, $5B, $BB, $B8, $00, $8B, $BB, $B6, $68, $BB, $BB, $79
  Data.a  $9B, $BB, $B9, $97, $BB, $BB, $BB, $BB, $BB, $65, $BB, $55, $BB, $5B, $BB, $BB
  Data.a  $00, $7B, $BB, $B6, $68, $BB, $BB, $B9, $97, $BB, $B7, $99, $BB, $BB, $BB, $BB
  Data.a  $BB, $65, $5B, $55, $B5, $5B, $BB, $BB, $70, $0B, $BB, $B7, $66, $BB, $BB, $B7
  Data.a  $99, $BB, $BB, $99, $7B, $BB, $BB, $B6, $BB, $65, $55, $55, $55, $5B, $BB, $BB
  Data.a  $B0, $08, $BB, $B7, $68, $BB, $BB, $BB, $79, $9B, $BB, $79, $9B, $BB, $BB, $B6
  Data.a  $BB, $66, $BB, $6B, $BB, $BB, $BB, $BB, $B8, $00, $BB, $B7, $68, $BB, $BB, $BB
  Data.a  $B7, $99, $BB, $79, $97, $BB, $BB, $B6, $6B, $66, $B6, $6B, $BB, $BB, $BB, $BB
  Data.a  $BB, $80, $78, $86, $6B, $BB, $BB, $BB, $BB, $B9, $99, $97, $79, $BB, $BB, $B6
  Data.a  $66, $66, $66, $6B, $BB, $BB, $BB, $BB, $BB, $BB, $87, $68, $BB, $BB, $BB, $BB
  Data.a  $BB, $BB, $BB, $BB, $BB, $BB
EndDataSection
and replace

Code: Select all

UseJCALG1Packer()

Define *lpBuffer

;==========================================================================================================================================================
; Load packed image from memory
;==========================================================================================================================================================

*lpBuffer = AllocateMemory(406)

UncompressMemory(?FontType, ?FontTypeEnd - ?FontType, *lpBuffer, MemorySize(*lpBuffer), #PB_PackerPlugin_JCALG1)

CatchImage(0, *lpBuffer)

FreeMemory(*lpBuffer)
with

Code: Select all

CatchImage(0, ?FontType)
And your exe is 3k smaller :mrgreen:
Because the packer needs more bytes than the 'unpacked' image.

Bernd
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: WordPad clone source

Post by davido »

@infratec,

Nice work. You make it look so simple.

I actually managed to produce the same DataSection as you did.
Got lost after that.

Thank you. :D
DE AA EB
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4790
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: WordPad clone source

Post by Fangbeast »

Nice work. You make it look so simple.
He does, doesn't he? And he fixeed thats ection for me in the first place because I wrote this six years ago and that definately had changed in compiler versions.

I should name this 'NoteInfraTec' or just 'NoteTec' in his honour:):)
Got lost after that.
He does that to me too:):):)

Will upload the new change today, when I wake up! (Done, I couldn't sleep!)
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Post Reply