Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0

    Delphi system has changed with Windows7


    Hello, I'm hoping this will be a fairly easy fix........
    I have a system that needs negative numbers put in the fields. We were using Windows XP and all was well. Now, we all received new computers that have Windows7 operating system and the users are complaining that when they put in a negative number, the minus sign goes to the back of the number instead of the front. This is so weird and I can't understand why it's happening. If anyone could shed some light on this I would be very grateful!!

    Thanks in advance!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    59
    Rep Power
    11
    Hi, sounds like regional settings. This can be amended from Control Panel -> Regional Settings in Windows. If its not this, then perhaps the component you are using for number input has some "mask" set on it - check its properties.

    Also google for

    SetLocaleInfo

    eg. usage:
    SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, P);

    The above set the decimal separator, perhaps you can use it to set that display format automatically instead of setting regional settings for each computer.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0
    Thank you for your response! I tried changing the regional settings but that didn't work. I wasn't even aware of those settings until you told me. I'm changing the field's properties to "True" for the ParentBidiMode under Localizable. That changed the minus sign to the front of the number now but as soon as i tab away, the whole number aligns to the left instead of the right. I'm looking for a way to change that now.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    59
    Rep Power
    11
    Which delphi components are you using on the form? (for the numbers)
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0
    I'm using the TMaskEdit in Delphi 2007. The other thing i don't understand is that a couple of users are not having any problems at all but myself and a few others are??
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    59
    Rep Power
    11
    Incase we didnt look at the same page. Its under Region -> Additional Settings -> negative Number Format



    Also make sure you are running your application under the same user for which you changed the regional settings (ie. not running the app as admin whilst changing the settings for a local user). I vaguely remember this may be having an effect.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    59
    Rep Power
    11
    Ok, perhaps the regional settings wont have an effect if you're using the TMaskEdit. What does your mask format look like?

    Danie
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0
    The regional settings look the same but I will check what user it is running under. I have to leave work today at 10:30 but I will work on this tomorrow and let you know. Thanks!!
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0
    The regional settings look like yours but how do i check what my app is running under? I'm not sure how to do that. Also, I didn't give my TMaskEdit any formatting. I changed the ParentBidiMode property to true which fixed the minus sign problem but the BiDiMode automatically changes to bdLeftToRight when i want it to be right to left.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    59
    Rep Power
    11
    bdiMode seems to be specifically for left to right / right to left.

    Use BiDiMode to enable the control to adjust its appearance and behavior automatically when the application runs in a locale that reads from right to left instead of left to right. The bidirectional mode controls the reading order for the text, the placement of the vertical scroll bar, and whether the alignment is changed.
    ParentBdiMode simply makes your control use the value of the bdiMode of the form / containers it's been placed on.

    Assuming you havent set the app to run as admin, just ensure that yuo arent running your delphi as Admin. If so your app will runb as admin (and not the current user). Just something to consider. But I doubt this would be the case / have an effect, the Currency setup wouldn't effect a Maskedit, so far as I can see.

    Ill keep thinking. Dont have any ideas just now - besides using a mask #99999999.99;1;_ (or similar) - but then it might not be perfect. Or using keypress events on a normal TEdit. Apologies for the lack of useful info :-)
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0
    You're doing great! Any info is useful info. Thank you! I will play around with this TMaskEdit some more and let you know the outcome. Right now, I am looking into this UseRightToLeftAlignment function.
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    59
    Rep Power
    11
    Hi,

    I assume you are using these components for numerical input. If so, you could consider looking at JEDI components (they have a whole batch of nice components including numerical edits). Also, its open source / free.

    If you don't want the whole library, i have attached a very simple attempt at a quick 5 minute numedit. Its in a package, just compile and install. You can change the source to suit your needs. It allows for maxlength, decimalplaces and allows only numbers and fullstop (for decimals). It doenst take into account system locale.

    http://simplydot.co.za/files/Package_DotNumEdit.zip

    Goodluck
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0
    Thanks for the info! I can't get into the site though. We are not permitted for some reason.
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    17
    Rep Power
    0
    Well, I didn't get fancy but i made a fix......just to keep you posted. I changed the ParentBidiMode to "true" under Localizable which fixed the minus sign problem and then I used this code to somewhat help the appearance of the numbers in the TMaskEdit:

    Begin
    For MskEdCnt:= 0 to ComponentCount - 1 do
    If Components [MskEdCnt] is TMaskEdit then
    TMaskEdit (Components[MskEdCnt]).Text := ' 0.00';
    End;

    This isn't the best fix but I also wanted to keep 0.00 in each field when the screen first pops up. The user said it really didn't matter if it right aligned or not.

    But now they can't print. I have to research that. The system was created in Delphi 2006 but when we got our new computers i couldn't get 2006 to work right so I installed 2007. Delphi2007 doesn't use RvProject component to print. I need to look for a replacement. Getting our new computers is what started all of this mess. Lol!

    Thank you for all of your help though!!
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    59
    Rep Power
    11
    lol :-)

    btw, accidentally came across this.
    If you're not looking for freeware specifically, I would recommend Fast Reports VCL, however what's below looks promising. Its the same guys, but with a freeware version. (less functionality but an option)

    http://www.fast-report.com/en/product/free-report-vcl/

    regards
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo