Menu

#3 String table

open
nobody
None
1
2010-07-14
2010-07-06
Nore
No

String table for settings

Discussion

  • Nore

    Nore - 2010-07-06
     
  • Dmitrijs Belovs

    Dmitrijs Belovs - 2010-07-14
    • priority: 5 --> 1
     
  • Dmitrijs Belovs

    Dmitrijs Belovs - 2010-07-14

    String tables were ignored on purpose. C4's "String resources" is biggest Eric's blunder and are completely unusable, unnecessary tedious and unfriendly in any way I can imagine.

     
  • Nore

    Nore - 2010-07-14

    I agree that C4 string tables are far to be the coolest feature of C4
    In a general manner, I try to fit as much as possible to C4' way-of-code. So I use string table when possible

    I found 2 major problems
    1 - The fact to have to reload it manually each time it was changed
    2 - The long line of code to write to get the string (compared to in place string)

    For the first problem, I added a piece of code in one of our plugin to reload them automatically (on Debug build)
    For the second, macro functions can do the job for us

    In a first thought, I planned to keep string tables to be able to translate strings to our language (or in our consumers') one day or another (well... I think it will be definitely another)
    I recently found some advantages using it. For example, writing menusetting items in code is boring and not really nice...
    but if you use the 'integer nature' of the string id, you can write some nice piece of code

    for i in [0, itemCount]
    title = get string of (<firstItemStringId> + i)

    with item string ids are
    'itmA', 'itmB', ... 'itmZ'

    The string table I provide uses the following piece of code for all menu items

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.