Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

gmauro

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • March 6, 2013 at 6:15 pm in reply to: Change background color of Editor Control #969
    gmauro
    Participant

    Yes, I have modified EditControl in this way:

    in the New method you must replace:

    New(mandatory = false, readonly = false, style = 0, bgndcolor = "",
    textcolor = "", hidden = false, tabover = false)
    {
    ...
    ...
    if Object?(bgndcolor)
    bgndcolor = RGB(bgndcolor[0], bgndcolor[1], bgndcolor[2])
    .SetBgndColor(bgndcolor)
    if Object?(textcolor)
    textcolor = RGB(textcolor[0], textcolor[1], textcolor[2])
    .textcolor = textcolor
    }

    with this:

    New(mandatory = false, readonly = false, style = 0,  hidden = false, tabover = false
    bgndcolor = "", textcolor = "", bgndcolor_readonly = "", textcolor_readonly = "")
    {
    ...
    ...
    if Object?(bgndcolor)
    bgndcolor = RGB(bgndcolor[0], bgndcolor[1], bgndcolor[2])
    .SetBgndColor(bgndcolor)
    if Object?(bgndcolor_readonly)
    bgndcolor_readonly = RGB(bgndcolor_readonly[0], bgndcolor_readonly[1], bgndcolor_readonly[2])
    if (bgndcolor_readonly == "")
    .SetReadOnlyBgndColor(RGB(240, 240, 240))
    else
    .SetReadOnlyBgndColor(bgndcolor_readonly)
    if Object?(textcolor)
    textcolor = RGB(textcolor[0], textcolor[1], textcolor[2])
    .textcolor = textcolor
    if Object?(textcolor_readonly)
    textcolor_readonly = RGB(textcolor_readonly[0], textcolor_readonly[1], textcolor_readonly[2])
    .textcolor_readonly = textcolor_readonly
    }

    Then you have to add these methods:

    SetReadOnlyBgndColor(color)
    {
    .bgndcolor_readonly = color is "" ? RGB(240, 240, 240) : color
    .bgndbrush_readonly = color is "" ? GetStockObject(SO.WHITE_BRUSH) : CreateSolidBrush(color)
    .color_readonly = .bgndcolor_readonly
    .brush_readonly = .bgndbrush_readonly
    .Repaint()
    }
    CTLCOLORSTATIC(wParam) //this is for the readonly case
    {
    if .textcolor_readonly isnt ""
    SetTextColor(wParam, .textcolor_readonly)
    SetBkColor(wParam, .color_readonly)
    return .brush_readonly
    }

    With these mods, you can do something like:

    w1 = Window(#(Vert (Editor font: “Verdana” size: 16 readonly: false)))
    w1.Vert.Editor.Set(“Hello”)
    w1.Vert.Editor.SetBgndColor(RGB(255,0,0))
    w1.Vert.Editor.SetReadOnlyBgndColor(RGB(0,255,0))

    w1.Vert.Editor.SetReadOnly(true) // <-- this will make the editor readonly and the background green w1.Vert.Editor.SetReadOnly(false) // <-- this will make the editor editable and the background red

    March 6, 2013 at 12:59 pm in reply to: Change background color of Editor Control #967
    gmauro
    Participant

    Thank you! After some research I discovered that if you catch the CTLCOLORSTATIC message, you can change the readonly background color too!

    So, if you add something like this to the EditControl:

    CTLCOLORSTATIC(wParam)
    {
    if .textcolor isnt ""
    SetTextColor(wParam, .textcolor)
    SetBkColor(wParam, .color)
    return .brush
    }

    SetBgndColor(…) will change the background even if the control is read-only! 🙂

    Now my problem is that if you use that code, then the readonly background color will always be the same of the not-readonly window…

    August 1, 2011 at 6:47 pm in reply to: New 110713 Version #885
    gmauro
    Participant

    Hi Andrew, the 110713 snapshot works, but there is a little problem. Being that I use my old code and old stdlib with the new exe (with a “Suneido.SwitchUnhandledThrow = false” line inserted in the Init function) it appears to work all except a little thing: let’s suppose I go in the menu “Help -> About Suneido”… Now, if I click on the scrollbar of the contributors list, there will be an “unhandled switch value” exception… Why Suneido give to me this exception, even though I have used the SwitchUnhandledThrow flag in the Init function? Maybe because the ScrollControl is loaded before the Init function?

    July 25, 2011 at 6:39 pm in reply to: New 110713 Version #884
    gmauro
    Participant

    Thanks, I will try this new version. Sorry for the late reply, but the sourceforge forum, sometimes is very very slow or inaccessible to me.

    July 7, 2011 at 5:28 pm in reply to: New 110705 Version #874
    gmauro
    Participant

    Yes I agree that changes sometimes are necessary and I appreciate all the efforts you make in Suneido development. But for now I have to make sure that my application is stable enough.
    I think You are right: a command line option to disable the things that could break old code would be very useful to help the migration.
    The new switch/behaviour breaks too many things in my application…
    P.S.: the parenthesis thing breaks many things too, being that I rarely use them in the expressions of the “if” statement…

    July 7, 2011 at 2:46 pm in reply to: Bug in query parser? #871
    gmauro
    Participant

    Thank you for the snapshot but there are some problems… I will explain them in the Announcements section of the forum, in the thread of the snapshot: link.

    July 7, 2011 at 2:45 pm in reply to: New 110705 Version #872
    gmauro
    Participant

    Hi Andrew, thank you very much for the snapshot, but unfortunately your new exe breaks too many things in my application code.

    For example:

    with the old suneido.exe (build Oct 21 2007) I could do:

     if a is true { return }

    but with the new exe it generates an error unless I do:

     if (a is true) { return }

    and this is very strange, because in the Suneido syntax, the parenthesis should not be mandatory in the expression of the ‘if’ statement.

    Another annoyance is the new switch/case behaviour. Let’s suppose that ‘x = 4’. Before, I could do:

     switch(x)
    {
    case 1:
    case 2:
    case 3:
    }

    but now it generates an exception unless I add a default:

     switch(x)
    {
    case 1:
    case 2:
    case 3:
    default:
    }

    Maybe this is the correct behaviour for a switch/case statement, but it’s very sad when a new language version breaks old code… For now I stick to the 2007 exe.

    July 2, 2011 at 8:50 am in reply to: Bug in query parser? #869
    gmauro
    Participant

    Hi Andrew, if you could post a snapshot with the bug fixed it would be very nice. Thanks!

    June 24, 2011 at 9:25 am in reply to: Master-Detail Relationship problems #865
    gmauro
    Participant

    Hi, have you checked that the ‘suneidolog’ table exists?

    In the QueryView, enter:

    suneidolog

    then press F9 and see the result. If you have errors, then I think your ‘suneido.db’ file could be damaged or you have messed up with the system tables. Try to reinstall Suneido and see if it helps.

    June 14, 2011 at 11:26 am in reply to: jSuneido Goes Live #814
    gmauro
    Participant

    If I run with Wine your “dvcore.exe”, then if I write in the workspace something very simple, like:

    Window(#(Horz (Static “Hello”)))

    and then I press F9 to execute this line of code, nothing happens… The workspace flashes for an instant, then… nothing!

    June 10, 2011 at 3:21 pm in reply to: jSuneido Goes Live #812
    gmauro
    Participant

    Hi, I have tried your Suneido on Ubuntu Linux with Wine 1.3.21 (latest development version) but it doesn’t work very well and it’s not much usable (and I don’t know why but it’s very slow).

    Anyway, what have you done to Suneido sources to make it work (a little, at least) with Wine? I noticed that there is a new library… It is necessary to make Suneido work with Wine?

    May 29, 2011 at 9:16 pm in reply to: jSuneido Goes Live #810
    gmauro
    Participant

    It’s great! Now, if only we could have a working client in Linux we could get rid of Windows… Why Suneido doesn’t work with Wine? It’s the garbage collector that generates problems? If at least the “Client/GUI interface” worked in Linux/Wine we could use jSuneido as server and Wine/Suneido as client…

    May 27, 2011 at 5:24 pm in reply to: Suneido sorting troubles… #861
    gmauro
    Participant

    Thankyou for your answer. Unfortunately, the definition of a new field with duplicated upper-case versions of the original field will waste space in the database, and I think could be problems with IdControl because this requires a key field for the searching and sorting column…

  • Author
    Posts
Viewing 13 posts - 1 through 13 (of 13 total)

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language