FHannes Posted November 9, 2012 Share Posted November 9, 2012 (edited) Time for some Beta builds. Because 3.37 contains some very important bugfixes, I have decided to push the release forward to this month, rather than releasing a minor bugfix build for 3.36. I will be adding some additional functionality into the color tools and some new TPA related functions before the RC hits. For now, I'd recommend using this build over 3.36. The final version of this will be released in 2 weeks tops. Regular: http://svn.scar-divi.com/scar/ Portable: http://svn.scar-divi.com/scar_portable/ Setup instructions: http://forums.scar-divi.com/showthread.php?505-Downloading-SCAR-Divi-Prerelease Changelog: Bugfixes: - [#127] Double clicking on a form element in the form designer will no longer assign an event internally - [#136] SCAR process sometimes did not terminate - Some selection features in color tools did not work properly - Dragging color tools items from/to stored colors sometimes lagged or froze SCAR - Small memory leak when loading png images - [#133] The new FindColor(s)SpiralTol(Ex) and FindColor(s)TPATol(Ex) functions did not return the correct results - [#139] Menu in DTM editor was detachable - GetCurrentKeyState and GetToggleKeyState did not function correctly for TSCARWindowClient - [#142] Some system colors were imported incorrectly - [#143] Several dialog functions were malfunctioning - TSCARBitmap.DC changed when TSCARBitmap.Flip() ot TSCARBitmap.Rotate() were called - TSCARBitmap.LoadFromStr set the entire bitmap to transparant - Error in firewall config when adding a rule New: - Rename button in color tools rightclick menu - procedure TPAEdge(var TPA: TPointArray); - Capture Client button in DTM editor Edit menu - TTPAArtifacts = set of (taXAxis, taYAxis) - function BmpFromTPA(const TPA: TPointArray; const FgCol, BgCol: Integer): TSCARBitmap; - function BmpFromTPAEx(const TPA: TPointArray; const FgCol, BgCol, AfCol: Integer; const Scale: Single; const Artifacts: TTPAArtifacts): TSCARBitmap; - function TSCARBitmap.GetPixels(const TPA: TPointArray): TIntArray; - procedure TSCARBitmap.SetPixels(const TPA: TPointArray; const Color: Integer); - procedure TSCARBitmap.Skew(const Horiz, Vert: Single); - function LibsPath: string; - function ScriptsPath: string; - procedure TSCARBitmap.RotateEx(const Angle: Extended; const Resize: Boolean); - procedure TSCARBitmap.SkewEx(const Horiz, Vert: Single; const Resize: Boolean); - function StrToPoint(const Str: string): TPoint; - function StrToPointDef(const Str: string; const Default: TPoint): TPoint; - function PointToStr(const Point: TPoint): string; - function StrToBox(const Str: string): TBox; - function StrToBoxDef(const Str: string; const Default: TBox): TBox; - procedure ExpandBox(var Box: TBox; const SizeChange: Integer); - procedure OffsetBox(var Box: TBox; const XOffset, YOffset: Integer); - function TPAEquals(const TPA1, TPA2: TPointArray): Boolean; - function TIAEquals(const TIA1, TIA2: TIntArray): Boolean; - function TEAEquals(const TEA1, TEA2: TExtArray): Boolean; - Added all DateUtils routines: http://docwiki.embarcadero.com/Libraries/XE2/en/System.DateUtils#Routines - function BoxCenter(const Box: TBox): TPoint; - procedure TPADistToPoint(const TPA: TPointArray; const Point: TPoint; out MinDist, MaxDist: Extended); - procedure TPADistToPointEx(const TPA: TPointArray; const Point: TPoint; out MinDist, MaxDist: Extended; out MinPoint, MaxPoint: TPoint); - Option to toggle template completion Tweaks: - TSCARBitmap's SaveToBmp, SaveToJpeg and SaveToPng now creates the target folder if it does not exist - It is now possible to ctrl+click to add an item to the selection in color tools - Huge performance improvements for all TPAFilterX and TPAExtractX functions - Huge performance improvements for TPAIntersect and TIAIntersect - CreateMessageDialog tied into resource manager for forms - Added thread-safety for CreateMessageDialog, MessageDlg, MessageDlgPos, TaskMessageDlg, TaskMessageDlgPos, ShowMessage, ShowMessageFmt, ShowMessagePos, InputBox and InputQuery - Removed the HelpCtx parameter from MessageDlg, MessageDlgPos, TaskMessageDlg and TaskMessageDlgPos - ImageBox/InputBox in Target Client renamed to ImageArea/InputArea for consistency - More accurate rotation algorithm for TSCARBitmap.Rotate() - The databox in the color picker is now wider to accommodate the large coordinates on modern screens - Moved color squares in the color picker's databox to the left to be consistent with the datapicker - Color picker magnifier now has red corners around the center pixel, the bitmap picker has been adjusted accordingly - The databox in the color picker now repositions around your cursor when it reaches the edges of the monitor your cursor is currently on - function Distance(const X1, Y1, X2, Y2: Integer): Extended; (now returns extended) - Editing the name of items in color tools is no longer possible through clicking - The delete key now allows you to delete items from color tools as well - You can now group colors (and groups) together into groups in the color tools Enjoy ~Freddy Edited November 13, 2012 by Freddy Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 9, 2012 Share Posted November 9, 2012 Yay!! Thanks a lot for fixing FindColor(s)SpiralTol(Ex). Glad you decided to change the plan for releasing this version a little earlier (with those very important fixes included) Keep up the good work! P.S. Pretty damn excited about those TPA functions, can't wait to see what you can come up with! -Jani Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 9, 2012 Share Posted November 9, 2012 Yay for the rename menu ... things just keep getting better, thanks Freddy Yeah btw, I got some more bugs to report, I'll load up the bug tracker right now. But they have nothing to do with color tools or forms Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 9, 2012 Author Share Posted November 9, 2012 Yay for the rename menu ... things just keep getting better, thanks Freddy Yeah btw, I got some more bugs to report, I'll load up the bug tracker right now. But they have nothing to do with color tools or forms I'll be waiting for them Just make sure you don't wait too long, 3.37 will be pushed out pretty fast. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 9, 2012 Share Posted November 9, 2012 Yeah that rename menu in Color Tools is really helpful! Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 10, 2012 Author Share Posted November 10, 2012 The latest SVN copy fixes a whole series of bugs + has a number of additional performance enhancements. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 10, 2012 Share Posted November 10, 2012 Nice, now the forms will look right, and I learned some things. GetBoxSize... Here is a comparison, using all of SCAR's dialog functions: [scar] program New; var value: string; begin ShowMessage('Wooohahahhahah ShowMessage'); ShowMessageFmt('Woaohahaha ShowMessageFmt: <%d>', [1234]); ShowMessagePos('WOoooooo ShowMessagePos', 0, 0); TaskMessageDlg('Testing TaskMessageDlg', 'Boooooooooooooooooooooo', mtConfirmation, [mbOK], 0); TaskMessageDlgPos('Testing TaskMessageDlgPos', 'Boooooooooooo', mtWarning, [mbYes, mbCancel], 0, 50, 50); MessageDlg('MessageDlg Wooooo', mtCustom, [mbOK], 0); MessageDlgPos('MessageDlgPos woooooo', mtInformation, [mbOK], 0, 50, 50); InputBox('InputBox, Woooo', 'Do you want input box?', 'Yes'); InputQuery('InputQuery woooooo', 'Hi do you want queries?', value); WriteLn(value); CreateMessageDialog('CreateMessageDialog Woooooo', mtError, [mbOK]); end. [/scar] I don't think CreateMessageDialog is working though. That or SCAR just crashed for another reason: And where are my Coordinates, that SCAR usually shows? Lols probably need to clear appdata again Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 10, 2012 Share Posted November 10, 2012 Yep, it errors for me aswell.. Simple 1 liner: begin CreateMessageDialog('CreateMessageDialog Woooooo', mtError, [mbOK]); end. Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 10, 2012 Author Share Posted November 10, 2012 Some of these functions work with forums, they aren't thread-safe... [scar]procedure CreateMsgDlg; var F: TForm; begin F := CreateMessageDialog('CreateMessageDialog Woooooo', mtError, [mbOK]); try F.ShowModal; finally F.Free; end; end; var V: TVariantArray; begin V := []; ThreadSafeCall('CreateMsgDlg', V); end.[/scar] EDIT: I'm going to make CreateMessageDialog itself thread-safe and tie it into the resource manager so it behaves like other forms. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 10, 2012 Share Posted November 10, 2012 Much appreciated, Freddy - thanks for pointing out. Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 10, 2012 Author Share Posted November 10, 2012 I've decided to add all of these functions into SCAR's main API rather than the forms API. As such, I've made all of them thread-safe, so you don't have tto use ThreadSafeCall to use them (which would currently cause errors [but not always]). Of course CreateMessageDialog still returns a form, so you'll have to use ThreadSafeCall to use this form as you would normally. I have however removed the HelpCtx parameter from all functions that had it. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 10, 2012 Share Posted November 10, 2012 (edited) Yeah awesome, I can add these into OSI now with an IFDEF SCAR 3.37 . I'm also going to add tons of Form functions, and this form for RS2: That can from my old OSI Bone Burier project I "started" lols. Edited November 10, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 10, 2012 Author Share Posted November 10, 2012 I've committed a new build with all of the thread-safe functions and such. @LordJashin: I also fixed your mouse coordinates. I'd also recommend forcing people to 3.37 once it's released in OSI. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 10, 2012 Share Posted November 10, 2012 I've committed a new build with all of the thread-safe functions and such. @LordJashin: I also fixed your mouse coordinates. I'd also recommend forcing people to 3.37 once it's released in OSI. K, I've made all the functions thread safe (the ones that needed it), and going to update OSI soon. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 10, 2012 Share Posted November 10, 2012 I'd also recommend forcing people to 3.37 once it's released in OSI.Agree with this. Once final of 3.37 is out, this is definitely best thing to do.So many important fixes / tweaks in 3.37 version! Will base MSSL to 3.37. Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 10, 2012 Share Posted November 10, 2012 Also, Freddy, I've got an idea. Can you add like a AddToScriptTerminate procedure? Or AddToTerminate. I'm trying to overload the ScriptTerminate procedure to add a (Safe) function that uses TaskmessageDlg to display an error telling people to Update their SCAR Versions: Then I could put this at the TOP of OSI.scar where the IFDEF SCAR's are. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 10, 2012 Share Posted November 10, 2012 (edited) Also, Freddy, I've got an idea. Can you add like a AddToScriptTerminate procedure? Or AddToTerminate. I'm trying to overload the ScriptTerminate procedure to add a (Safe) function that uses TaskmessageDlg to display an error telling people to Update their SCAR Versions: Then I could put this at the TOP of OSI.scar where the IFDEF SCAR's are. I have been thinking about this aswell (AddOnTerminate), it would be sooooo much more useful (especially in includes) than just having ScriptTerminate procedure.But mate, I think you should request it at MantisBT, like all suggestions. Sure hope it will be added though! Edited November 10, 2012 by Janilabo Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 10, 2012 Share Posted November 10, 2012 Well I thought their might be a way to overload it, but I guess not. He probably won't agree with this idea, so I guess I'll just wait for the Includes system to come out for this. Almost done with this form I'm adding, then I'll update OSI. Is there a way to ThreadSafeCall a function, and pass parameters? Also what does the v hold? True or false or just the result of the function? Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 10, 2012 Author Share Posted November 10, 2012 I'm actually already planning on implementing such a system, but go ahead and post it up on mantis if you like, it's not really high up on my todo list atm. I don't really see why you need to put this in a terminate callback though... Or how it would change anything, if you use 3.37 stuff, the script still won't compile in 3.35, so the callback would never be called anyway. That's why there's the {$ERROR } directive. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 10, 2012 Share Posted November 10, 2012 Yeah, I would mainly use AddOnTerminate for unsetupment of MSSL, that way I wouldn't need to use it anymore for scripts.. If I use ScriptTerminate inside MSSL, and someone also uses it in hes/her MSSL-based script aswell, that would give Duplicate identifier Compiler Error (that's obvious, of course).. Thats why AddOnTerminate would be nice thing to have. But as I see you have already planned that kind of a system, I'll see what future brings someday. -Jani Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 10, 2012 Share Posted November 10, 2012 Well, I have experimented and... Some Dialog functions work fine in 3.35-3.36. Its just they are not "ThreadSafe" so you must use the ThreadSafeCall function. For 3.37 they automatically do this. But doing ThreadSafeCall on them, shouldn't be bad. Dialog functions DO NOT WORK under ThreadSafeCall if a Form is loaded!!! I don't know why this is weird... I think the AddOnTerminate/Overload ScriptTerminate would be great. We can always use {$IFDEF SCAR337_UP} if we need to. I just thought it would be nice to have a message dialog for Updating SCAR for OSI to work. And the way to do this would be like this: [scar] // Check if SCAR Divi is version 3.35 or higher {$IFNDEF SCAR335_UP} procedure ScriptTerminate; overload; // override it somehow/overload w/e begin {$IFDEF SCAR337_UP} TaskMessageDlg('Please Update SCAR Divi', 'OSI: Please update SCAR Divi to version 3.35 or higher to run this script!', mtWarning, [mbClose]); {$ELSE} TaskMessageDlg('Please Update SCAR Divi', 'OSI: Please update SCAR Divi to version 3.35 or higher to run this script!', mtWarning, [mbClose], 0); {$ENDIF} end; {$IFDEF SCAR320_UP} {$ERROR OSI: Please update SCAR Divi to version 3.35 or higher to run this script!} {$ELSE} 'OSI: Please update SCAR Divi to version 3.35 or higher to run this script!' {$ENDIF} {$ENDIF} [/scar] Ofc though we would need to put TaskMessage in another function. Then just call it using ThreadSafeCall Quote Link to comment Share on other sites More sharing options...
Janilabo Posted November 10, 2012 Share Posted November 10, 2012 LJ, can't you do something like this (doesn't really require terminating): {$IFNDEF SCAR336_UP} begin TaskMessageDlg('Please Update SCAR Divi', 'OSI: Please update SCAR Divi to version 3.37 or higher to run this script!', mtWarning, [mbClose], 0); end. {$ENDIF} begin WriteLn('Yay, SCAR Divi 3.37[+]!'); end. I do this in MSSL: http://svn.scar-divi.com/mssl/trunk/MSSL.scar (although I use $ERROR, but I could replace it with mainloop + MessageDlg) 1 Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 10, 2012 Share Posted November 10, 2012 Wow nice Find! Damn I'm repping you for this one Jani! Woot I'll update it asap Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 11, 2012 Author Share Posted November 11, 2012 I've uploaded a new build that comes with the new BmpFromTPA(Ex), which allows you to draw a TPA onto a bitmap. Tha background is also assigned set up for alpha blanding by default. So if you enable AlphaBlend, you can it as an overlay onto another bitmap easily. Check this sample: http://svn.scar-divi.com/scar/samples/BmpFromTPAEx.scar Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 11, 2012 Share Posted November 11, 2012 With that library, and your awesomeness Freddy, I am sure there will only be more of these functions. I haven't had the chance to try out all the TPA/Bmp/color/ etc functions you've changed around yet... Quote Link to comment Share on other sites More sharing options...