HOW-TO: Make textpads Search & Replace dialogs bigger

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
dflock
Posts: 5
Joined: Thu Feb 12, 2004 2:24 pm
Location: UK
Contact:

HOW-TO: Make textpads Search & Replace dialogs bigger

Post by dflock »

I find that the Search & Replace dialogs in TextPad are too small, especially when using regular expressions; it makes if difficult to write complex regexes if you can't see the whole thing at once. Ideally the dialogs would be re-sizeable, but only Hellos can do that.

Not sure how many people know this but there is something that you can do, right now, to your copy of TextPad to fix this. All you need to 5 minutes and a resource editor. Try this one: http://www.users.on.net/johnson/resourcehacker/ if you don't already have one.

All you need to do, AFTER making a backup copy of textpad.exe (and closing it, if it's already open) is:
  • Open textpad.exe in your resource editor
    Find dialogs 28, 35 & 36 and stretch them as wide as you want them
    Move the buttons and resize the edit controls to fit the new width
    Save the new textpad.exe
Now just open the new textpad.exe and try them out. They aren't re-sizeable, but at least they're bigger!

Hope someone finds this useful.

Dunc.

PS: I've never had a problem with Resource Hacker or this technique, but I REALLY MEAN IT about making a backup. Resource Hacker makes ones for you, but I usually keep an original .exe around, just in case.
Also, this works on just about any windows gui .exe or .dll - and not just for dialogs either. Don't like those toolbar icons? Change them!
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

I would really like to hack.. err.. fine tune the font used in these dialogs,
Courier would be ideal for me. Is that possible?
Or, if that's not an option, at least make the current font bigger.
Thx for your tip!
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
dflock
Posts: 5
Joined: Thu Feb 12, 2004 2:24 pm
Location: UK
Contact:

Post by dflock »

Sorry, not as far as I know. I've just had a quick play and couldn't see a way to do it. You can change it in Windows, but this is a global setting affecting all programs. If that's what you want then play with your settings in Control Panel/Display/Appearance.
User avatar
Drxenos
Posts: 209
Joined: Mon Jul 07, 2003 8:38 pm

Post by Drxenos »

dflock wrote:Sorry, not as far as I know. I've just had a quick play and couldn't see a way to do it. You can change it in Windows, but this is a global setting affecting all programs. If that's what you want then play with your settings in Control Panel/Display/Appearance.
Well, I just tried it and it works great! Just modify what ever resource you want to change, recompile the resource, and save.
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Just went through this procedure and set the dialog font to "Courier New" - 10.
Regex's like " *(([^"][^ "]*)|("[^"]*"))" are now readable in the combo boxes 8)
I no longer have to work with them in the main window and do a copy paste all the time.
On the downside, all the fonts in the dialog boxes are "Courier New" - 10 and that makes
them huge to say the least.
But being able to work in the dialogs with regex's means I will keep this "hack" :shock:

Related but..
Is this "legal"? Pls comment. Textpad support is outstanding as it is, but
something tells me I'm off limits here and I have lost any rights to that
support using this sort of "hack". Tell me I'm wrong ;)
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

From the license agreement:
Limitations on Reverse Engineering, Decompilation, and Disassembly.
You may not reverse engineer, decompile, or disassemble the Software Product, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
:idea: Perhaps Helios could provide a listing of Resources that would be allowed to be modified, under what limitations, such as OK to change fonts, icons, dimensions, remove buttons, etc. Restrict adding buttons, changing Style settings, Captions, Adding/Changing alternate keys, etc. This would be another marketing and user feature that other editors do not provide.

This modification of dialogs, icons, etc. could actually become a whole new category of TextPad Add-ons that users could contribute to the existing libraries of syntax, macros, clips, etc.

Also need to realize that any upgrades would require users to re-do their modifications. Would probably require user to maintain a database of resource name that is modified, original values, and replacement values.
Hope this was helpful.............good luck,
Bob
User avatar
dflock
Posts: 5
Joined: Thu Feb 12, 2004 2:24 pm
Location: UK
Contact:

Limitations

Post by dflock »

Hi,
Yes, you can change the font. Sorry for the misinformation; not sure how I missed that one. In my defence, it only works per dialog not per control - which is what I was looking for. :oops:

Also, don't get too exited about this technique - resources are static - it's the program code that makes them do stuff (like react to user input etc.). You can move them around and change their properties; you can switch icons and bitmaps out for new ones; and you can change strings.

You can add new controls, but they won't do anything when you click on them - you would need to add code to TextPad for that. For example you can make dialogs resizeable just by setting the CBS_THICKFRAME property on the dialog. Try it - the dialog will now resize (because windows is drawing it and you're now asking for a resizeable window) but the controls inside it will stay put. You'd need to add code to shuffle them around in response to their window being resized.

Not sure about legality, but it seems pretty harmless, especially if you don't distribute stuff. Obviously up to Helios. I did find this though:
http://www.bome.com/Restorator/ which can create "ResPatcher" .exe's to distribute just your changes to an executable's resources. They claim these are legal as they only contain your own work (ie. the changes) but that sounds a bit dubious to me.
You'd probably still have to re-do the "ResPatcher" it for each new release of texpad anyway.
User avatar
Drxenos
Posts: 209
Joined: Mon Jul 07, 2003 8:38 pm

Post by Drxenos »

Ok, Bob, I gotta know: that they baby picture a real person? I can't tell.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Ok, Bob, I gotta know:
Mommy says "a face only a mother could love"
Hope this was helpful.............good luck,
Bob
bveldkamp

Post by bveldkamp »

s_reynisson wrote:I would really like to hack.. err.. fine tune the font used in these dialogs,
Courier would be ideal for me. Is that possible?
Or, if that's not an option, at least make the current font bigger.
Thx for your tip!
If you haven't done so already, please vote here: http://textpad.com/forum/viewtopic.php? ... a06c6c2718
OrbMan
Posts: 13
Joined: Fri May 23, 2003 1:21 pm

Post by OrbMan »

Great! Thanks for the tip.

I am now using Tahoma 8 for my dialogs, and the size is much better now.
bwolmarans2
Posts: 2
Joined: Thu Oct 21, 2004 10:23 pm

Post by bwolmarans2 »

OK so now I have a wide entry field for find and replace, and yes, that helps, but my gosh it is so short (top to bottom) that only the tiniest font will fit in there. If I use resource editor to make font larger, all the font for button and label get bigger, but the entry field stay really tiny...why? Help my eyes are going out of focus..why can't textpad make this larger, we are all programmers, we know that for programmers as skilled as the ones that wrote textpad, this would be 5 minutes of work at the most....
User avatar
dflock
Posts: 5
Joined: Thu Feb 12, 2004 2:24 pm
Location: UK
Contact:

Post by dflock »

Could you post or link to a screenshot of you problem dialog?
bwolmarans2
Posts: 2
Joined: Thu Oct 21, 2004 10:23 pm

finally fixed it!

Post by bwolmarans2 »

Remove the CBS_OWNDERDRAWFIXED from the string then change the font size!
jk
Posts: 1
Joined: Mon Sep 26, 2005 2:14 pm
Location: Brookline, MA

Post by jk »

I used XN Resource Editor and changed the search boxes. I also want to change the font. Where is the "CBS_OWNDERDRAWFIXED" located? I'm a novice at this and was unable to find it the registry and resource editor.

Thank you. -- Justin
Remove the CBS_OWNDERDRAWFIXED from the string then change the font size!
Post Reply